eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.56k stars 1.43k forks source link

low simulation speed when 'show-route' is active #12644

Open namdre opened 1 year ago

namdre commented 1 year ago

has been bothering me for a long time. Has to do with locking:

https://github.com/eclipse/sumo/blob/257a45cbb43e58a488906f8e8920d5701a72bbb6/src/gui/GUIViewTraffic.cpp#L385-L392

namdre commented 1 year ago

On windows, sumo-gui didn't use the dedicated graphics card by default. Setting this to be the "preferred adapter" made a huge FPS difference.

There is still a problem with dropped frames due to locking. This is quite noticeable when tracking a vehicle with 'show route' enabled. The simulation speed is fine but the gui refresh rate goes very low.

namdre commented 1 year ago

background: normally vehicles are only rendered when their current lane is in view and then only the currently drawn lane is locked against vehicle modifications. However, 'show-route' should also work if any of the route edges is in view even though the vehicle itself is not on the screen. The "brutal" solution corrently employed is to lock the whole simulation against vehicle modifications while rendering the route. This ensures that the route doesn't change (or the vehicle isn't exiting) during route rendering but comes with a huge cost in gui refresh rate.

namdre commented 1 year ago

threre is a somewhat related problem where the gui may freeze when using traci with show-route in particular when having multiple simulations open.