Files
UnrealEngineUWP/Engine/Source/Runtime/Core/Private
jason hoerner 110bd98b0a UE5: Optimizations when memory tracing is enabled: 5x perf increase with -llmcsv, 8x perf increase with -trace=memory.
#rb matt.peters johan.berg ionut.matasaru brandon.dawson jason.nadro
#rnx

Over half the perf gain was from reducing critical section locks, with the rest of the gains split between an optimization to call stack traversal (caching return address lookups in a lock free map), and enabling TLS related optimizations for MallocBinned2, which were inadvertently disabled when tracing was enabled (this also saves some locks).  Multiple lock types had to be optimized before measurable perf gains were observed, due to contention on remaining locks increasing as the first few locks were removed.  A total of 6 types of locks were removed or reduced:  AnnounceFNameTag, MallocBinned2, TagDataNameMap, Enum tag data lookup, Windows callstack trace, LLMMap.

* Added hash table utility class TGrowOnlyLockFreeHash which supports lock free reads, writes using a critical section, and no deletion.  This is intended for classes that represent caches of one-time initialized debug data used during memory tracing, which never needs to be freed.
* TGrowOnlyLockFreeHash applied to 4 sets/maps used when memory tracing is enabled, including tag data, announced tag names, call stack functions, and call stack IDs.
* Lock striping added to LLMMap.  This isn't a good candidate for a lock free approach, as it has a heavy amount of modification, and lock free approaches tend to perform worse than lock striping in that case, plus it would be a massive undertaking to make this lock free.
* A future lock to be removed would be the one in "FLowLevelAllocInfo::GetTag", protecting the "FLowLevelMemTracker::TagDatas" array, saving a couple percent more perf.
#preflight 6132a3a6bf137d00019a8c97

#ROBOMERGE-SOURCE: CL 17428762 via CL 17429451
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17429480 by jason hoerner in ue5-release-engine-test branch]
2021-09-03 20:58:47 -04:00
..
2021-08-24 19:28:38 -04:00
2021-09-02 13:41:10 -04:00
2021-06-14 13:40:06 -04:00
2021-08-25 06:26:44 -04:00