Add even more profiler events

This commit is contained in:
Wojtek Figat
2021-07-07 15:15:33 +02:00
parent afc5bb5731
commit 6938821467
13 changed files with 115 additions and 18 deletions

View File

@@ -217,7 +217,10 @@ void PrefabInstanceData::SerializePrefabInstances(Array<PrefabInstanceData>& pre
writer.EndArray();
// Parse json to get DOM
instance.Data.Parse(tmpBuffer.GetString(), tmpBuffer.GetSize());
{
PROFILE_CPU_NAMED("Json.Parse");
instance.Data.Parse(tmpBuffer.GetString(), tmpBuffer.GetSize());
}
if (instance.Data.HasParseError())
{
LOG(Warning, "Failed to parse serialized scene objects data.");
@@ -462,7 +465,10 @@ bool PrefabInstanceData::SynchronizePrefabInstances(Array<PrefabInstanceData>& p
writer.EndArray();
// Parse json to get DOM
defaultInstanceData.Parse(tmpBuffer.GetString(), tmpBuffer.GetSize());
{
PROFILE_CPU_NAMED("Json.Parse");
defaultInstanceData.Parse(tmpBuffer.GetString(), tmpBuffer.GetSize());
}
if (defaultInstanceData.HasParseError())
{
LOG(Warning, "Failed to parse serialized scene objects data.");
@@ -666,7 +672,10 @@ bool Prefab::ApplyAllInternal(Actor* targetActor, bool linkTargetActorObjectToPr
newPrefabInstanceIdToDataIndex.EnsureCapacity(ObjectsCount * 4);
{
// Parse json to DOM document
diffDataDocument.Parse(dataBuffer.GetString(), dataBuffer.GetSize());
{
PROFILE_CPU_NAMED("Json.Parse");
diffDataDocument.Parse(dataBuffer.GetString(), dataBuffer.GetSize());
}
if (diffDataDocument.HasParseError())
{
LOG(Warning, "Failed to parse serialized scene objects data.");

View File

@@ -372,7 +372,10 @@ bool PrefabManager::CreatePrefab(Actor* targetActor, const StringView& outputPat
{
// Parse json to DOM document
rapidjson_flax::Document doc;
doc.Parse(actorsDataBuffer.GetString(), actorsDataBuffer.GetSize());
{
PROFILE_CPU_NAMED("Json.Parse");
doc.Parse(actorsDataBuffer.GetString(), actorsDataBuffer.GetSize());
}
if (doc.HasParseError())
{
LOG(Warning, "Failed to parse serialized actors data.");