Too much time in RenderMeshSystemV2

Hi, im trying to instantiate a bunch of entities and move them at runtime. They are currently instantiated but the RenderMeshSystemV2 takes too long.


Someone know how to reduce this time?I leave the code that I use to instantiate here below

 if (spawnBallsAuto)
        {
            //for (int i = 0; i < 10; i++)
            //{
            objfps = GameObject.FindGameObjectWithTag("FPSCount");
            objfps.GetComponent<BallsCount>().balls += 1;
            //obtenemos los ghost
            var ghostCollection1 = GetSingleton<GhostPrefabCollectionComponent>();
            //obtenemos el id del ghost que nos interesa
            var ghostId1 = ProyectoNetcodeGhostSerializerCollection.FindGhostType<PelotaSnapshotData>();
            //su prefab
            var prefab1 = EntityManager.GetBuffer<GhostPrefabBuffer>(ghostCollection1.serverPrefabs)[ghostId1].Value;
            //y lo instanciamos
            var pelota = EntityManager.Instantiate(prefab1);
            float xa = UnityEngine.Random.Range(-10, 10);
            float ya = 2.5f;
            float za = UnityEngine.Random.Range(-10, 10);
            //le añadimos el componente de posicion
            EntityManager.SetComponentData(pelota, new Unity.Transforms.Translation { Value = new float3(xa, ya, za) });
        }

And the code to move the entities

public class MovePelotaSystem : JobComponentSystem
{
    protected override void OnCreate()
    {
        RequireSingletonForUpdate<EnableProyectoNetcodeGhostSendSystemComponent>();
    }
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        return Entities.WithAll<PredictedGhostComponent>().ForEach((ref Translation trans,ref PelotaComponent pelota) =>
        {

            if (trans.Value.y >= 9)
                trans.Value.y = 2.5f;
            else
                trans.Value.y += 0.03f;
        }).Schedule(inputDeps);
    }
}

Show timeline view in profiler? It could just be waiting for transform systems to complete. The Hybrid Renderer hard completes all JobHandles operating with LocalToWorld.

Is a little confusing, but RenderMeshSystemV2 is the older renderer, and HybridRendererSystem is Hybrid Renderer V2. At least in 0.8.0-preview.18. I have with 24,000 cubes with Build-in and RenderMeshSystemV2 40ms, with HybridRendererSystem and URP 9.0 1.5ms.

You can also try ScheduleParallel.

Thank you two, i try deactivating my transform systems but still wasting too much time. I’ve tried to install HybridRendererV2 but it gives me errors for other packages that I can’t update right now. Anyway i try with ScheduleParallel and that reduces the time noticeably