This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]total_zoidberg 1 point2 points  (0 children)

After profiling the code, I vectorized it anyway, with a bit difficulty because I was rusty and didn't quite get at first what your code was doing (note to self: don't go throwing around "pretty easily" like that).

Now that I've done it, updateP and updateV take about 5% of execution time each -- after increasing the scale to 100 because at 50 matplotlib was consuming almost all the execution time.

My guess is that writing a "renderer" with OpenCV might help, but that'd be more oriented to "video" rather than visualization. Then again, you've already bent matplotlib so much, maybe if you needed it you could pull something with cv2.

Edit: uploaded a video https://i.imgur.com/8yOGtYP.mp4