Hello!
Would there be any interest in some runtime optimisations for heaptrack GUI?
One of the pain points of working with heaptrack has been the GUI, where loading up a very large profile would sometimes take over an hour on a pretty beefy CPU with a modern SSD. Unfortuntely not an uncommon occurrence in my domain.
To overcome this limitation, I have a bunch of modifications for the heaptrack codebase
(in order of load time savings, largest first):
- Merge stage 1 & 2 of the GUI loading process (3 → 2 stages)
- Reduces load time by 1/3
- Constant memory overhead (Currently tuned to 1MB)
- Broke some unit tests in the process, would love some help to fix those
-
further inline and handroll
getline
&memchr
(to find end-of-line), avoid string copies whenever possible -
Optimise for cache locality, manage register pressure, devirtualise some functions
-
Branchless implementation of
readHex
Some less portable or controversial(?) changes
- Optimise
memchr
with hand-rolled SSE implementation - Remove support for older heaptrack file formats
- Bumped the build to C++20
With those changes, I’m seeing 7x faster load times consistently across profiles of all sizes. Of course, YMMY.
I’m more than happy to put together a series of patches for any of the aforementioned changes.
Thanks!