ig-memtrace
ig-memtrace copied to clipboard
Performance improvement
You'll definitively hate me :)
Anyway, while running the current version of our software with Memtrace, I got something like 1 frame every 10 seconds, meaning running our test scenario tooks hours.
Looking at task manager, MemTraceTool.exe was using 100% of a core while our application was simply waiting for Memtrace to become responsive.
Profiling Memtrace easily detected the culprit: about 99% of the CPU time was spent in List::Contains(), which is called in TraceTranscoder.cs line 534.
Adding a complimentary HashSet to perform this operation in a non-linear time made a huge difference (our application is running at half of its normal speed now, which is more than acceptable).
I'm not very good with pull requests, I thought you would be easily able to find the two little changes using WinMerge on your side. Attached the updated TraceTrancoder.cs file renamed as .txt (.cs files can't be attached).
I would be really glad if you could check and merge that change in the main branch, it makes MemTrace simply usable again for us !
Thanks a lot :)