Implementation of a Incrementally Defragmenting Auto-Sizing Multi-Arena Allocator#3634
Draft
douira wants to merge 10 commits into
Draft
Implementation of a Incrementally Defragmenting Auto-Sizing Multi-Arena Allocator#3634douira wants to merge 10 commits into
douira wants to merge 10 commits into
Conversation
always check segment assertions for now, potentially improve arena sizing fix free list corruption bug work more on compaction, disable for now as it doesn't work well bug fixes, correct owner change logic, improved deallocation heuristics, improved arena sizing compact smallest arena into free space if possible, new arena sizing heuristics prevent oscillation when emptying arenas by not allowing new allocation during emptying-related eviction properly handle migrating zero-usage regions, and fix bug by not deleting the only existing arena if there's only one deallocate arenas when there's enough margin of usable free space in other arenas to evict its contents update only the segments that changed when defragmenting use 32mib index arena by default improve heuristics to reduce defrag effort when not needed refactor defrag code for moving free spaces towards each other limit copy and byte budget for defragmenting renames for clarity improve fragmentation measure, show total defrag copies and volume, modulate brightness of visualizer segments defragment towards second biggest segment to reduce number of copies and copied bytes Incremental defragmentation buffer visualization detect best shared arena to place region correctly notes on defragmentation split free tracking into a separate class use multiple shared buffers rename to shared arena TreeMap has been profiled to be much faster fix bugs, improve names more assertion use tree list to track free segments fix crashes when f3 is open and arenas are gone young gen buffer handling migrate gl buffer arena to be generated by a central instance to make buffer sharing more elegant and not leak shared buffers
…ps percentiles and the fps display on the debug screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors the buffer arena to consist of multiple large buffers that are shared by multiple regions with logic to incrementally defragment, allocate, and deallocate them and move regions between them as buffers fill up.
Remaining todos:
Closes #2683
Closes #2233