DayDayUp
MModular
•Created by DayDayUp on 10/2/2024 in #questions
How to improve the performance of formatting output
I wrote a piece of scientific simulation code as shown below:
Its performance is much lower than that of C/C++ and Swift. I know I’m a rookie at coding… As I’ve checked, the lagging part is: out += str(self.location) + "," + str(self.velocity) + "," + str(self.acceleration) + "\n". Are there any good ways to optimize the data output?
22 replies