Heap testing

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
grenders22
Posts: 16
Joined: Thu Mar 01, 2018 10:09 am

Heap testing

Post by grenders22 »

What algorithms do you use when testing heap performance? How to read the code execution time? With the help of PIT?
8infy
Member
Member
Posts: 185
Joined: Sun Apr 05, 2020 1:01 pm

Re: Heap testing

Post 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.
thewrongchristian
Member
Member
Posts: 426
Joined: Tue Apr 03, 2018 2:44 am

Re: Heap testing

Post 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
Post Reply