Why so slow? #1124
Replies: 4 comments 3 replies
-
(This is not an answer) I haven't spent much time on these part of the codebase, and so can't give you relevant info, but just wanting to encourage you that any opportunities for performance optimization are welcome! Though in most medium-big models, it is likely that |
Beta Was this translation helpful? Give feedback.
-
@ValerioB88 We are having a dev meeting this Saturday. Our front end is always a topic of discussion and we have even talked about rebuilding it but have lacked what we feel is the requisite expertise. Your more than welcome to attend if interested. |
Beta Was this translation helpful? Give feedback.
-
I looked a bit into this, because I remembered how much fun profiling I had in the past. Unfortunately the frame rate that your are seeing is just how fast (or slow) the model is running. I timed model runs with and without the visualization timer and they are the same. |
Beta Was this translation helpful? Give feedback.
-
I believe this question has been answered, so I am going to close it for now for clean-up. |
Beta Was this translation helpful? Give feedback.
-
this is not a critique of the tool, which I really appreciate, but a request of clarification. I have tried a "stripped down" version of mesa to see how fast it can get, and it's not as fast as I expected, and I would like to understand why.
In particular, I looked at the "boid_flockers" example. In the
server.py
I commented out theboid_canvas
so there is no visualization in the server.Then in
model.py
, inBoidFlockers.step
, I comment out theself.schedule.step
, so that the model doesn't do anything.The maximum frames per second by default is 20, so I changed the js code to get the slider up to 1000 fps.
I run the simulation and rump up the fps slider to 1000fps. However, 1000fps is never reached: I measure around 125fps.
As far as I understand, the code isn't doing much apart from network communication. So is this value expected? Is the boid_flocking example doing something more under the hood? (I don't see any data collection, but I am new to mesa so I might have missed it).
Is this "delay" completely due to websocket communication? Is it expected? Is there any way to speed it up?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions