Profiler and LocalToWorldThreadedSystem
Added a simple profiler Testing LocalToWorldSystem with Parallel execution for root nodes
This commit is contained in:
@@ -28,6 +28,8 @@ internal class Program
|
||||
{
|
||||
//systems.Add(new ParentSystem(world));
|
||||
systems.Add(new LocalToWorldSystem(world));
|
||||
systems.Add(new LocalToWorldThreadedSystem(world));
|
||||
editorSystems.Add(new EditorProfilerWindow(world));
|
||||
editorSystems.Add(new EditorHierarchyWindow(world));
|
||||
|
||||
Entity ent1 = world.CreateEntity("parent");
|
||||
@@ -47,6 +49,20 @@ internal class Program
|
||||
|
||||
Entity ent5 = world.CreateBaseEntity("entity5");
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Entity newEnt = world.CreateBaseEntity();
|
||||
world.Set(newEnt, new LocalTransform(new Vector3(i, i, i), Quaternion.Identity, Vector3.One));
|
||||
|
||||
Entity parent = newEnt;
|
||||
for (int j = 0; j < 10; j++) {
|
||||
Entity newChildEnt = world.CreateEntity();
|
||||
world.Set(newChildEnt, new LocalTransform(new Vector3(j, j, j), Quaternion.Identity, Vector3.One));
|
||||
Transform.SetParent(world, newChildEnt, parent);
|
||||
parent = newChildEnt;
|
||||
}
|
||||
}
|
||||
|
||||
// Open project.
|
||||
// Setip EditorGui.
|
||||
EditorGui.Initialize();
|
||||
@@ -56,16 +72,24 @@ internal class Program
|
||||
{
|
||||
foreach (MoonTools.ECS.System system in systems)
|
||||
{
|
||||
system.Update(Engine.Timestep);
|
||||
using (new ProfilerScope(system.GetType().Name))
|
||||
{
|
||||
system.Update(Engine.Timestep);
|
||||
}
|
||||
}
|
||||
|
||||
// Editor Update.
|
||||
EditorGui.Update();
|
||||
|
||||
using (new ProfilerScope("EditorGui.Update"))
|
||||
{
|
||||
// Editor Update.
|
||||
EditorGui.Update();
|
||||
}
|
||||
|
||||
// Try Catch UserCode Update.
|
||||
|
||||
world.FinishUpdate();
|
||||
using (new ProfilerScope("world.FinishUpdate"))
|
||||
{
|
||||
world.FinishUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleOnRender()
|
||||
|
||||
Reference in New Issue
Block a user