Performance Overview

Today I ran the automated performance test of my game with Unity 2018.3.0b3 and present the results below, just like I did before, during older beta cycles:

According to my tests, 2018.3.0b3 is the slowest of the 2018 series with my project. It’s about 1ms to 1.5ms slower than 2018.1 for example.

I haven’t looked into what exactly is causing this performance difference yet.

How does the performance test work?

The (first-person) game I’m working on features an automated performance test. It works like this:

  • Camera is placed at a defined position in the scene

  • Camera makes a 360 degree rotation around the Y-axis within 20 seconds (slowly rotating around y)

  • Every second the test captures the average CPU frame time of the last second

The game runs just like it would normally do, but the camera/player does not move and the AI in unable to see the player.

It measures the “base-line” of the game so to speak. If an actual gamer plays the game, more things are going to happen, which is missing in the test, such as visual and sound effects when firing weapons, additional AI to hunt the player and more navigation pathing.

I run this test in a Standalone Windows 64bit (Mono) Player. The following Physics settings are applied:

  • Physics.autoSyncTransforms=false

  • Physics.autoSimulate=true

  • Physics2D.autoSyncTransforms=false

  • Physics2D.autoSimulate=false

The y-axis represents the average CPU time in milliseconds, how long “one frame took”. The x-axis represents the sample points while the camera makes its 360° rotation. Each test runs for 20 seconds, one sample every second, thus 20 samples for each test. Fewer milliseconds (vertical axis) indicate better performance.

3739591--310390--2018_3_scene_4_3.png
3739591--310393--2018_3_scene_5_4.png
3739591--310396--2018_3_scene_6_8.png

9 Likes

I wonder if it’s physics related like my performance issues were.

It was my first assumption too.

Physics regressed several times with new Unity versions in my project. I have a simple test project that I used to submit those physics performance regression issues in the past. Unfortunately, I wasn’t able to reproduce the performance drop with this test-case in 2018.3 anymore, so I’m not really certain it’s (only) physics.

I need to investigate this in detail, just need to find time.

What I could find so far, it seems there are at least two performance regressions in 2018.3.

The physics regression you posted:
https://discussions.unity.com/t/716786

… and an UI performance drop:
https://discussions.unity.com/t/715111
https://discussions.unity.com/t/715019

1 Like

The physics regression reported by @KillHour was reproduced internally and has been fixed locally. It’s in review and should be available in b6.

Thanks a lot guys, awesome work!

1 Like

For physix you may also give it a go to the physx experimental editor based on 2018.2 that includes 3.4.1 in my tests that did run like a missile. In .3 betas it did not run that smoothly but there where many other things broken that could be making it lag.

The regression was introduced during the 2018.3 alpha and doesn’t affect the experimental build or earlier versions than 2018.3a6. Let’s see if we can get 2018.3 back to missile speed once this has been resolved.

3 Likes

I re-tested Unity 2018.3.0b6, below are the results. It seems the performance drop now became even more significant :hushed:

While building a Player, Unity printed many:

… errors. Maybe the performance drop is somehow related to this issue?! I’ll re-check if this problem has been fixed.
Wrong data

3798802--319069--2018_3_0b6_scene_4_3.png

3798802--319072--2018_3_0b6_scene_5_4.png

3798802--319075--2018_3_0b6_scene_6_8.png

4 Likes

More detailed information + bug reports would be greatly appreciated.

When did this start to happen? With b6? This might be related: https://discussions.unity.com/t/715054

This is the issue tracker link:
https://issuetracker.unity3d.com/product/unity/issues/guid/1087228/

If this is the same test each time from Peter, is there a good reason his test isn’t part of Katana or other automated testbed yet given it’s been consistently useful :stuck_out_tongue:

2 Likes

Yeah I know, I need to find time to investigate these issues. It’s a more complex issue that takes time to analyze and come up with an isolated repro.

I just remembered I actually posted this problem a few weeks ago. I first noticed it using b3, but I don’t remember if I earlier tested versions too.
https://discussions.unity.com/t/716914

Knowing this issue existed when I tested b3, I guess the performance drop is not directly related to it, since b3 ran faster than b6.

It’s the same test. I created a copy of my game a few months ago, which I since then used to test all betas.

It’s the same thing, no modification done to the project copy since the very first performance test, to make sure the tests are meaningful.

In order to run the test, I have to build a player and start the generated .exe file, which then spits out a .csv file once it’s done.

1 Like

I was investigating the issue and noticed after I profiled b3 last time, I turned off various PostProcessScene steps in the project, to check if it affects the “Destroying a Prefab…” error and I didn’t turn those on again.

Sooo… the huge performance drop from my previous b6 profiling session can be seen as wrong data, because it was measuring the performance without any optimization steps, thus significantly slower than before and not a meaningful comparison to earlier profiling results.

However, since PostProcessScene causes some issues here , I ran those optimization steps outside “build player” to have the proper optimized scenes and then did a build afterwards.

The results are much more like Unity 2018.2 now, see below. 2018.3 is still slower than 2018.1 with my project though.

3804220--319750--2018_3_0b6_scene_4_3.png
3804220--319753--2018_3_0b6_scene_5_4.png
3804220--319756--2018_3_0b6_scene_6_8.png

5 Likes

Thank you for the info and at the same time it’s quite sad to see such results. There is a new version of PhysX which is quite faster but we have the same performance… I hope it’s due to the beta version and the final one will be more better.

Yeah it’s pretty underwhelming. I had hoped that PhysX 3.4 will boost physic performance but after some tests it’s far from the case and it’s even worst. Going back to 2018.2 right now :frowning:

Same here, a VR experience was runing at 72FPS in 2018.2.14, and around 65FPS (noticeable frame drops) on 2018.3.0b9 (Still trying to find what is happening… no luck)

@Peter77 can you please make your test with 2019.1 alpha?

I guess this depends a lot on what kind of physics your game relies, in coming from unity 4.7 in 2018.2 I had to reduce the timestep to 1.5 for a joint based tank vehicle not to have explosive physics. In the experimental 2018.2 eidtor using 3.3physx and 2018.3 using 3.4 I can double the dimestep without having noticeable issues hence the cpu stress release, and I could even push higher.

I tested Unity 2018.3.0b11 today:

3924823--335116--2018_3_0b11_scene_4_3.png

3924823--335119--2018_3_0b11_scene_5_4.png

3924823--335122--2018_3_0b11_scene_6_8.png

Looking at the output_log.txt player log file, also contains some issues:

WARNING: Shader Unsupported: 'Legacy Shaders/Diffuse' - Pass 'Meta' has no vertex shader
Gfx command not handled: -1744732208 (Last command: 10018)
(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2489)

Gfx command not handled: 493 (Last command: -1744732208)
(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp Line: 2489)

Is the “Gfx command not handled” a known issue? The error was printed only twice and the game looked fine to me, no idea what’s wrong.

Your current multi-scene setup has inconsistent Lighting settings which may lead to different lighting when loading scenes individually or in a different order! Consider homogenizing the following:
1/6 scenes use different skyboxes.

(Filename: C:\buildslave\unity\build\Runtime/Graphics/LightmapSettingsManager.cpp Line: 123)

Your current multi-scene setup has inconsistent Lighting settings which may lead to different lighting when loading scenes individually or in a different order! Consider homogenizing the following:
1/7 scenes use different skyboxes.

(Filename: C:\buildslave\unity\build\Runtime/Graphics/LightmapSettingsManager.cpp Line: 123)

Your current multi-scene setup has inconsistent Lighting settings which may lead to different lighting when loading scenes individually or in a different order! Consider homogenizing the following:
1/8 scenes use different skyboxes.

(Filename: C:\buildslave\unity\build\Runtime/Graphics/LightmapSettingsManager.cpp Line: 123)

Your current multi-scene setup has inconsistent Lighting settings which may lead to different lighting when loading scenes individually or in a different order! Consider homogenizing the following:
1/9 scenes use different skyboxes.

(Filename: C:\buildslave\unity\build\Runtime/Graphics/LightmapSettingsManager.cpp Line: 123)

Your current multi-scene setup has inconsistent Lighting settings which may lead to different lighting when loading scenes individually or in a different order! Consider homogenizing the following:
1/10 scenes use different skyboxes.

(Filename: C:\buildslave\unity\build\Runtime/Graphics/LightmapSettingsManager.cpp Line: 123)

I reported the “inconsistent Lighting settings” issue during 2018.2 beta, seems it’s not fixed yet.

4 Likes

This is being discussed here: https://discussions.unity.com/t/708056/41

Could you please submit bug reports for these? They’re not known issues.

1 Like

Did this get reported with a reproduction case? These error messages are an indication of something wrong in the internal graphics command queue and it would be good to be able to reproduce it and debug it and fix it

2 Likes

I didn’t report it yet. It’s a more complicated case to get a reproduce for it, outside the actual project.