How is C++ code faster than blueprints?

I see all over the forums that “Blueprints are 10x slower than C++”, so my intuition tells me to start replacing blueprints in my projects with C++ code.

But… how is performance actually affected?

  1. Will anything happen if I start replacing random parts of my blueprints with C++ code?

  2. Or is this 10x figure only true for an all-blueprints vs an all-C++ project?

  3. Or are blueprints slower because of the inputs/outputs instead of how they actually work on the inside? This reducing the number of nodes by adding C++ code would help?

i thought that Blueprints WERE C++ code… its my understanding that the code is basically written and adjusted in the background when you edit and change nodes…

i assume that you would be able to merge multiple nodes into code… but aside from that i dont really know

Hi, I found 2 post from the Epic team answering this question on the forum:

Short answer

Long answer

Hope it helps :slight_smile:

The answer is here : What is the cost of using Blueprint instead of C++? - Blueprint - Unreal Engine Forums

Yeah this is the closest to what I was looking for.

Basically I was curious about when it is “worth it” to work on replacing blueprints with code.

While the statement C++ code runs ~10x faster than blueprints is true, bear in mind that in most simple cases it really doesn’t matter. If you have your blueprints doing simple tasks that end up taking 0.01ms, then turning them into C++ is a huge waste of time. Big time-consuming tasks that take > 0.5ms, like pathfinding algorithms ought to be in C++, but simple gameplay logic and other things Blueprints are commonly used for are fine the way they are.

It’s way less slower than 10x. I’d say max 30% slower, not that much.

But yes I agree it’s pointless to convert every simple BP to C++ for performance sake

Back when UE4 first came out I did performance benchmarks using complex algorithms like A*. The results were about 10x faster for C++, but to your statement, the regular uses of blueprints are not nearly as bad. Like the other link says, it depends greatly on what the code is doing. Unfortunately I did my benchmarks on a work-for-hire job so I can’t post results.