From 2722ed46c3fbc5759446dba2767bfabab2f321e9 Mon Sep 17 00:00:00 2001 From: srikappa-amzn Date: Fri, 11 Jun 2021 10:03:20 -0700 Subject: [PATCH] Reset prefab system in all prefab benchmarks --- .../Tests/Prefab/Benchmark/PrefabInstantiateBenchmarks.cpp | 4 ++++ .../Tests/Prefab/Benchmark/SpawnableCreateBenchmarks.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/PrefabInstantiateBenchmarks.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/PrefabInstantiateBenchmarks.cpp index 5713b226b2..19180431a2 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/PrefabInstantiateBenchmarks.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/PrefabInstantiateBenchmarks.cpp @@ -41,6 +41,10 @@ namespace Benchmark { newInstances[instanceCounter] = m_prefabSystemComponent->InstantiatePrefab(templateToInstantiateId); } + + state.PauseTiming(); + ResetPrefabSystem(); + state.ResumeTiming(); } state.SetComplexityN(numInstances); diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/SpawnableCreateBenchmarks.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/SpawnableCreateBenchmarks.cpp index 8e4c2eaad7..fdecde3732 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/SpawnableCreateBenchmarks.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/SpawnableCreateBenchmarks.cpp @@ -36,7 +36,8 @@ namespace Benchmark AzFramework::Spawnable spawnable; AzToolsFramework::Prefab::SpawnableUtils::CreateSpawnable(spawnable, prefabDom); - + + ResetPrefabSystem(); state.ResumeTiming(); }