Large Performance Regression in UE5 (CPU Performance)

Greetings! So the story goes as follows. I’m developing a game that’s going to release on Switch/PS4 so the team has been working on improving the game’s performance as much as possible. For this post I’m going to focus mainly on CPU Performance

We moved from UE 4.25 to 5.3 3 months ago, and since some weeks ago we are working on 5.4. So to start the optimizations that we have done in these 3 months are massive. All the logic was moved to C++, lots of branchless code, just with the exception of a plugin (Fluid Ninja Live), I optimized engine settings, activated pso precaching, optimized collisions, removed physics as much as possible, using widget invalidation, optimized all Skeletal Meshes in the game (which resulted in big performance gains), all animation logic moved to c++ and several other optimizations. Deactivated many unused engine plugins. Also moved to 5.4( 12/13/23 ) using the clang compiler which outperformed MSVC consistently across different scenarios and projects.

5.4 msvc

5.4 clang

In short, we have been very thorough in optimizing the game specially for the cpu. As for game logic, only way to get more performance at this point would be to move to ECS, but this is not why I’m making this post.

Comparing 4.25 to 5.3 Directly

The reason I’m making this post is because when we moved from 4.25 to 5.3 the game got a huge performance regression. See here (Devs Builds)

4.25 (also tested 4.27 which was somewhat slower but still way faster than 5.3/5.4)

5.3 (just after moving the project from 4.25)

As you can see world tick / game is 2X faster on 4.25!

And no, there’s no error in these results. We have been very careful with maintaining the same settings(I’m aware project settings change when changing ue version)/verified actor count/ OF COURSE lumen /nanite is not on, both dx 12, and yes I did test shipping, dev, etc. These are real results, don’t doubt our findings, I’ve simplified the presentation of the differences, but they absolutely remain accurate to reality. We know what we are doing.

In an attempt to investigate this further I made 4.27 projects and then made a 5.3 copy of the same project. I did this with graphic intensive scenes and also with barebones projects. Unreal 4 was outperforming UE5 as long virtual shadows or UE5 specific features were not being used (UE5 can outperform UE4 in several cases when using VSM for example). My last attempt at figuring this out was to simply make a empty scene , and start adding stuff just to see when I could spot a deviation.

To my surprise there was no point in which UE5 started being slower than UE4, because by comparing an empty scene UE4 was twice as fast as UE5. And this was escalating with pretty much anything (on world tick/game ms)!.

My initial speculation that either the skeletal meshes, niagara or particle systems were inherently more expensive on UE5. But I was absolutely surprised after testing many scenes just to find that UE4.25 remained 2x to 1.6x faster than UE5, no matter if it was an empty scene or a scene from my game.

Also ram and vram usage is higher on UE5.

4.25
statdetailed4.27

5.3
statdetailedRamue5.3

Well, now I will show how much better the current version of the game is running on 5.4 clang

Got world tick down from 7.04ms to 4.29ms , which is very significant and I’m happy we managed to get it this fast. But the 4.25 version is still faster in every significant aspect, having world tick at 3.42ms and running at 180fps when 5.4 is running at 120. A huge 60fps difference !

           --------------------------------------------------

Of course, if we apply the same optimizations from our 5.4 build in 4.25 game would be even more performant. I estimate it would make 4.25 run at 1.9ms - 2.1ms. This performance difference is so big that we are considering backporting the project back to 4.25 for the game to perform good on Switch and PS4.

We want to avoid this of course, so I’m trying to figure out what’s making UE5 perform so much worse than UE4, and figure how to gain some performance back.

Here a list of performance harming suspects

-Game units being doubles in UE5:
Would like to know if this could be part of the reason, I wouldn’t think that it would make THAT much of a difference, but Transform/Render Data and component transforms could be much more expensive because of this)

-Render Thread Somehow being much more expensive in UE5:
My data shows this clearly, the render thread is heavier on UE5. I wonder why this could be, maybe it’s because of nanite/lumen stuff being part of the rhi even though deactivated. Maybe UE5’s shader’s PSOs are even higher in quantity compared to UE4. Honestly I don’t have much of a clue here, only someone experienced with the RHI could know what’s going on.

-Chaos:
The project is pretty much just using chaos on it’s collisions queries. But when profiling I did find out that collision cost was higher on UE5(chaos). We know Chaos is less performant that PhysX so it could be the base cost of Chaos (even though project is not even using ragdolls and almost no actors with gravity). Also Chaos has a lot of optimizations only available for the ISPC compiler, however I don’t even know if it’s properly supported in 5.4. See.

Here the results from an empty black scene:

4.27 (it was actually stable at 0.10ms but the screenshot slowed it down to 0.12ms)

5.3 (it was actually stable at 0.15ms but the screenshot slowed it down to 0.16ms)

The only actor in this scene is the basic game Mode stuff, the stat numbers almost didn’t change at all, just were modified slightly by the screenshot. As I said before even from this point we have a good representation of how performance compares. UE4 being from 1.5x-2x faster than ue5 (with 4.25 being faster than 4.27)


To wrap up this post, I just want to say that it would be great if someone from Epic can provide insight on these findings. As for our project, we are really needing every ounce of performance for our game to run at a solid FPS target, if possible, having a 60fps mode in Switch/PS4.

The figures I’ve shown here are already making a difference in how the games runs on said consoles so if we can get a tip on how to improve the engine performance (by making some modifications to the engine, for example I know that by modifying how components transform update, by avoiding recalculations on every component in line a decent amount of performance can be gained ) that would be extremely helpful and enlightening.

Just tested 5.0 and cpu metrics report pretty much the same as 5.3, only difference is higher ram usage in 5.3

16 Likes

Thanks for the detail perf test, my guess would be lot of optimisation were made since 4.27.

Networking, physics etc and several bugs from ue4, so these improvement lead to some cost in perf in ue5.

Chaos for example like you said is more costly but behave better than physics ue4 and i don’t think we can switch that back in ue5.

You might get more detail from Session Frontend but am not sure if that worth to lead to any conclusion. :innocent:

1 Like

Good read. Thanks for sharing. Its unlikely you’ll get a reply from Epic here. You’d have better luck trying another channel, or going along to a conference where Epic are speaking. Try to call in a favor from a dev with UDN access. Anyway helping bump this to get more eyeballs on it.

All active projects here are still on 4.27 (plus 4.18 for where there some things are still TBD). So reading this is terrifying. Your testing was mostly CPU only, or you’ve done GPU tests as well (benchmarks for DX11 vs DX12 vs Vulkan?)? Won’t help, but looking forward to the day AI can profile UE projects for you, and spit out perfectly formatted English about how to optimize it all, or just Do-It-All for you automatically. As you lose so much time going down these kinds of rabbit holes or black-hole exploration, versus having more time for adding gameplay features.

Can’t rule out translation / language barriers here, but your post makes no sense tbh. ‘A lot of optimization’, implies things should run faster. That’s the dictionary definition. Don’t you mean a lot of NEW features were added to UE5 which has led to UE5 being more bloated and slower, which now means more optimization is needed, which hopefully gets done over time by Epic…

There’s actually quite a lot reports just on this channel for starters, where devs are reporting the complete opposite of this. Lots of users are stuck in situations where they don’t want to upgrade away from UE4, because of the chaos that is the engine feature of the same name. :stuck_out_tongue_winking_eye:

1 Like

Yes I have done gpu tests. I already know how the different apis are performing. At this point we don’t need more profiling but just insights on Unreal inner systems and how to optimise them in order to approach 4.25 levels of performance as much as possible.

Someone with some level of experience with the unreal source should be able to give some insights, I have already received some (the component transform recalculation for example). But for now I think I need insight on the RHI. Also, Im not sure if the public 5.4 actually has the multithreaded RHI already, while I see a performance increase vs 5.3 is not that significant. (Compiling with clang provides a major improvement).

if you think worse out of people yup it wont make sense.
if you fix a bug or improve something visually, that doesnt always mean better fps.

Well as for plain on optimization we have the use of a bunch of ISPC to several system including Math, Animations, skeletal meshes, etc. While it’s true that 4.25 already had ISPC incorporated. More systems have been moved to ISPC since them.

I wanted to check quickly how chaos was affecting performance by testing the project on 4.2x Chaos but just found out that the Chaos Engine versions of UE4 were removed from the launcher. Will have to download the source to check how it goes.

Hopefully will do it later today just after I get some crucial work done.

Reminds me about the performance dip when 4.25->4.26 happened, hehe. I dont think it was never fully addressed even though they tried. It was the last UE version that ran good.

I know this is a thing, but are you sure you ain’t referring the the rhithread being disabled by default on 4.26 leading to decreased gpu performance

Have found some critical insight already on this case. So, turns out the base cost of tick has increased. This would explain the aforementioned regression.

I haven’t got time to compile/ test 4.27 chaos yet, whenever I do it, I will come back with further explanations of my findings.

The elephant in the room which is the performance regression must be addressed to make hobbyists continue to use UE5, my project is using 5.2 which is significantly faster than 5.3 / 5.4. What’s the best UE4 version is it 4.25? and lots of games such as Conan Exiles are using modified 4.1x

chaos … at first … all other mutch less

How have you measured that. From which features is that coming ? I’ve tested my project on 5.0, 5.2, 5.3 and several versions of 5.4. Didn’t found a performance regression within 5 versions, with 5.4 bringing performance improvements only. Well only an increased-on ram usage but cpu timmings were the same.

Still havent tested because of epic removing 4.27 chaos from launcher and the fact that the source build requires and older version of Net. Forcing me to uninstall current one

Still waiting for this to be fixed since UE5 came out… Sad that I can’t use all the new cool features

Tested the shipping builds of 5.2 and 5.3 versions of my project, it’s very surprising that 5.2 version has double the fps of the 5.3 version
The performance difference is even more than running inside the editor
Lumen, Nanite and Temporal Super are turned off for the same project and tested on both RTX 3050 laptop and RTX 4070 desktop
I don’t understand what’s been changed by 5.3, if the trend is going on the new UE5 games would require NASA computers to play
I could upload screenshots as proof later but it takes hours to cook my current project and I deleted the last 5.3 build of my project
What’s the performance of the recent 5.4 version I’ve not tested it with my project

I am having the same problem. The performance of ue5.2, 5.3 is much worse, especially in PIE. Epic should add a section in Project Settings where you can downgrade some features

I’ve heard this more than 4 times already. Not sure what’s going on there, but it may be some sort of bug or specific configurations. Because I’ve run multiple tests in both my projects and tech demos both in editor/dev/shipping and 5.3 has outperformed 5.2 consistently from my tests.

Would be good to know from where the performance regressions comes for you guys.

Well as I mentioned before only bad thing I found about 5.3 was increased ram usage.

I’m closely working with 5.4 and have just updated the engine with a push from today. I keep seeing performance improvements, for example there was a Niagara VectorVM improvement today, pretty nice.

2 Likes

It’s available from the launcher :
image

The performance bottle neck comes from the environment assets, the character BP and other BP assets don’t have noticeable difference, several large realistic environments I bought e.g. Modular Medieval Environment etc. dropped fps to 50% when updated from 5.2 to 5.3.
Lumen, Nanite and Temporal Super Resolution were turned off and used the same project settings.
Are there any hidden engine options turned on by default from UE5.3?

Cant really say much about the performance drop from 4 to 5 since my performance opt. and debugging skills are not great. But for you it might be VSMs causing the issue. Try setting most of the scene to static validation (actor settings/rendering). You could also try changing the default lod bias for lumen shadows to a higher value. The default is -1.5 and it used to be 0 some engine versions ago.