Massive Performance Difference between normal Game Objects and Converted Entities.

I tried DOTS the other day and was wandering why the RenderMeshSystem takes so much CPU power. So I made a sample Projekt

4096 Sheeps (Free Asset from Assetstore)

FIrst try without Entitie Conversion

200FPS

Then With Entite Conversion:

What you have to do from just a normal Gameobject converting to make it faster?

With Burst its a different Story:

But why is there so much difference?

are those entities moving ?
if not try to add the StaticOptimizeEntity it will increase it a lot.

1 Like

At first i didnt make it move. Now I’m moving it.
But good to know that there is even a more performant way.

At the Moment i play around having 5k units walking to a point. After I saw That 4k Units can get 400 FPS I was wondering why in my other projekt I get 60FPS with the same Prefab.

In this case I used

: MonoBehaviour, IConvertGameObjectToEntity

In my other case I used

            entity = GameObjectConversionUtility.ConvertGameObjectHierarchy(sheep, settings);
            var instance = entityManager.Instantiate(entity);

and spawning 5k units over Time.

But it looks like when spawning many Units over Time the Performance is pretty bad

Either you spawn all units directly or you have bad performance.

I think there is a trick how to handle spawning units

what does the profiler show ? is it slow at rendering or somthing else ?
make sure you enabled the Enable GPU Instancing option in your material ?

Yeah it shows this. But I dont understand it

did enabled the Enable GPU Instancing option in your material ?

Yes it is On.

The Problem was in the Shadow/Lighning system.
It droped the Fps so hard.

Now I got into the same MeshSystem Limitation but with 55k moving Units
5295774--531645--upload_2019-12-18_18-28-59.jpg

5295774--531648--upload_2019-12-18_18-29-30.png
Is there a way to make it even faster?

Now you are running into this issue which I dug into a fair bit last week: Turning off culling of RenderMeshSystemV2

If this is all the same mesh, you can do it much faster. But there are always trade offs so they question is, what is the use case?

After some playing around again and reverting all my Changes, it didnt work like that again.
I get 60FPS with 5k Units instead of 55k Untis.

The goal is having Many Units and then add a Rigedbody to smash them with a Hammer and let them fly anywhere.
Also they all search for a target to attack if they are not smashed.

Try without the build in render system and use drawmeshinstanced. Just try it in a normal mono

More background I.e. in the 200k sprite thread on the forum

Actually I use 3d model not Sprites. and I dont render myself. I just MeshRender the thing

But now i know what the biggest performance impact was.
Entities 0.3 is for me 100 Times slower then 0.4
Or its the Hybrid renderer 0.3 that is slower then 0.3.1

Now atleast I get 40k Units with 60fps just by updating dependencies

1 Like

drawmeshinstancedindirect works with any mesh - the thread is just for reference, i.e. what i posted there is i.e. not optimized for quad and works with any mesh

1 Like

burst is only 2X from gameobject? Is it burst+job?