Page 1 of 1
Heap testing
Posted: Thu Nov 05, 2020 8:39 am
by grenders22
What algorithms do you use when testing heap performance? How to read the code execution time? With the help of PIT?
Re: Heap testing
Posted: Thu Nov 05, 2020 8:41 am
by 8infy
Compile on your host system and benchmark using available tools for that system. E.g visual studio offers great tools for performance profiling.
Re: Heap testing
Posted: Thu Nov 05, 2020 5:08 pm
by thewrongchristian
grenders22 wrote:What algorithms do you use when testing heap performance? How to read the code execution time? With the help of PIT?
What do you mean by "heap performance"?
Peak allocations/second? Allocation overhead? Time/space overhead? Concurrency and scalability?
A heap will have many, sometimes contradictory, performance metrics. For example, an allocator that is optimal in single threaded mode, may well have course grained locking as a result, and pay the price in concurrent scalability.
Similarly, a highly concurrent allocator might have a higher locking overhead, or have per-CPU memory caches which increase space overhead and reduce memory utilisation.
Personally, I'm happy with a heap that is correct and doesn't corrupt itself. I've still lots to implement before I have a have a practical usable kernel, and so long as my heap interface is sufficiently abstract, I can change/optimize/replace the heap easily, so unless you have a particular interest in optimized heap implementation, I'd limit performance tuning to making sure your algorithms are reasonably scalable. Ie. Use data structures to track allocations that don't degrade badly as counts go up, so avoid things like linear scans of linked lists.
First Rule of Optimization