Mission to improve render performance

I’m a bit doubtful of the timings per line and I’m not sure those can be trusted…

For eg, subMesh.getMesh().alphaIndex is only a return this.mesh for getMesh() and .alphaIndex is a direct access to the property as alphaIndex is not a getter, it is simply public alphaIndex.

If you really want to see what’s going on if you disable/remove some lines, you can get the sources locally, make the changes and generate a custom package for your testings.

[…] In fact, there’s an easier way which is to simply override BABYLON.RenderingGroup.renderSorted with your customized function.

You were right, the info is off. Sometimes the numbers are off by one line, very deceptive.

I followed your advice and altered some of the functions in the render tree (basically removing code that does not seem to affect my scene in any way) and here are the results (this is the perftest I was talking about, so not a static scene):

no alters:
render time / mesh: 0.029121

altered render, evaluate and renderSorted:
render time / mesh: 0.023908

that’s about 18% faster.

As you can see I should copy less meshes, so that’s a next step.
bindForSubMesh is also one I should look at, but it’s a long complicated function :sweat_smile:

If there is interest in what I removed let me know. I can do a bit more detailed post.

1 Like