Replies: 2 comments
-
The data in above is measured wrongly, it is time of delta(). Which equals 18ms for most of time. Today I tried to measure frame's First -> Last stage, and following is new data. Kinda same conclusion, in my case(a simple 2d game), single thread is way better than parallel scheduler. iOS Default |
Beta Was this translation helpful? Give feedback.
-
I would say that it's not super surprising that single threaded is faster than multithreaded. The multithreaded executor has some overhead associated with it and it'll depend on how many systems can actually execute in parallel whether it'll be worth it or not. There is a small improvement to the overhead that has been merged into main that might help some, but probably doesn't completely close the gap for your case #4919. The implementation of the task scope used in the system executor has a tight loop in it, which is what I would expect to be causing the cpu spikes. Some discussion here about it #4718. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am developing a game for iOS with bevy. When I test the code in my iPhone 12 pro max, the game works but fresh rate is unstable, cpu usage is also relative high (around 50%). After some guessing and trouble shooting, I think the parallel executor introduced some significant overhead.
I did a quick and dirty verification, by modify Stage::parallel() return the single_threaded(). So all ecs systems are using single threaded scheduler, and my game performance improved. Following data is frame time distribution for 5s. It seems parallel scheduler has much better min frame time and much worse max frame time.
I instrumented the code, there are cpu spikes in parallel scheduler, which calls out some stack like "waker.clone()" / "async_tasks::header::Header::register".
Is this a known issue?
Beta Was this translation helpful? Give feedback.
All reactions