02-04-2024, 07:52 AM
(This post was last modified: 02-04-2024, 07:55 AM by josemendez.)
(01-04-2024, 04:15 PM)ShawnF Wrote: In this version, I'm getting an average of ~110 FPS with Oni and ~30 with Burst. It's a pretty big difference, which makes me think that the burst version isn't working correctly for some reason.
Hi!
As explained before, deep profiling will have a huge negative effect on Burst while having no effect at all in Oni. It's useful to determine what's slowing down some specific piece of code (that's the reason why I initially asked you for a deep-profiled session of Burst), but not when making A/B tests or absolute performance measures.
Quote:Keep in mind that deep profiling injects a lot of extra measurement calls in C#, making it run a lot slower than usual. Oni is unaffected by this since it's precompiled C++, so Unity is unable to add any extra stuff into it. As a result, Burst's performance is hindered a lot more by deep profiling than Oni's.
The reason is that deep profiling tells Unity to disable all compile-time optimizations and inserts extra instrumentation instructions in the code to measure time taken by every single function call, which makes it run a lot slower.
Burst is compiled by Unity, so it is affected by this. However Oni comes as a precompiled C++ library - essentially a black box- which means it can't be changed in any way by Unity and is hence unaffected by deep profiling.
As a result, Burst-compiled code will basically behave as regular C# when using deep profiling (or when using a development built with deep profiling support enabled), and you'll lose most of its benefits.
Furthermore, in your case FixedUpdate is being called 5 (!!) times per frame when using Burst:
but only 2 when using Oni:
This is a quite bad case of death spiraling, which makes me suspect your project either has a very large maximum allowed timestep or a very small fixed timestep.
- How's performance with deep profiling disabled?
- What are your project's timestep settings?