-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make several improvements to binary page allocator #299
Make several improvements to binary page allocator #299
Conversation
Performance drops a fair bit for low allocation sizes and increases for larger ones: Before:
After:
Note that this benchmark is very antithetical to how normal allocations go, because it constantly allocates a piece of memory and then deallocates it; i.e. no more than 1 allocation ever lives at the same time. Real world performance should be much less impacted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to admit, don't fully understand the code. 😦 But let's try it...
1cab9b3
to
45a48bf
Compare
This commit makes two main changes to improve the performance of the binary page memory resource. Firstly, it makes the allocator more eager to unsplit (i.e. merge) pages so that they can be reused for new allocation, which should reduce the memory footprint of when using very large allocations. Secondly, it sets a minimum size of allocations per superpage, which depends on the size of the superpage. This prevents very small allocations from ending up in massive blocks (increasing fragmentation) and also decreases the total number of pages (increasing performance).
This commit makes two main changes to improve the performance of the binary page memory resource.
Firstly, it makes the allocator more eager to unsplit (i.e. merge) pages so that they can be reused for new allocation, which should reduce the memory footprint of when using very large allocations.
Secondly, it sets a minimum size of allocations per superpage, which depends on the size of the superpage. This prevents very small allocations from ending up in massive blocks (increasing fragmentation) and also decreases the total number of pages (increasing performance).