Skip to content

Allow objects to span multiple contiguous blocks for bump allocator #1298

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

Closed
wants to merge 2 commits into from

Conversation

k-sareen
Copy link
Collaborator

@k-sareen k-sareen commented Apr 8, 2025

No description provided.

k-sareen added 2 commits April 8, 2025 06:40
Copy link
Collaborator

@wks wks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@k-sareen
Copy link
Collaborator Author

k-sareen commented Apr 9, 2025

Did you want me to run a perf analysis of this or no?

@wks
Copy link
Collaborator

wks commented Apr 9, 2025

Did you want me to run a perf analysis of this or no?

I think this is straightforward enough. But if you want, you can measure the probability of "the newly acquired block is right after the current block". I think it should be 100% for SemiSpace, GenCopy and GenImmix if both the application and the GC are single-threaded (i.e. a single mutator + a single GC worker thread). But it may well be 0% if it is multi-threaded.

@k-sareen
Copy link
Collaborator Author

k-sareen commented Apr 9, 2025

It's not necessarily a 100% because it could be a new chunk. But yes, close to 100% for single-threaded GC (or mutator for that matter). I just meant since it's a change to the slow-path, to evaluate the perf implications of it.

@k-sareen
Copy link
Collaborator Author

Closing PR because it makes the mutator much more noisier without any benefit. Note that this was somewhat expected since this PR was more for the single-threaded case and not the multi-threaded case. This is SemiSpace running with 1.5x SemiSpace minheap.

image

@k-sareen k-sareen closed this Apr 10, 2025
@qinsoon
Copy link
Member

qinsoon commented Apr 10, 2025

This is just an optimization/fix for a pathological case where there is only one allocating thread and the object frequently cannot fit into the rest of the current allocation buffer. When you have multiple threads but only one is actively allocating, we may also see an improvement.

The improvement may not be from allocation throughput, as with the patch, we just save some slow path allocations. But we could get improvement from better memory utilization.

@k-sareen
Copy link
Collaborator Author

Well yes. I have measured improvements for lusearch with single-threaded GC. But the above was the multi-threaded GC case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants