Skip to content
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

Add visit_slice to EdgeVisitor #986

Open
wks opened this issue Oct 16, 2023 · 0 comments
Open

Add visit_slice to EdgeVisitor #986

wks opened this issue Oct 16, 2023 · 0 comments
Labels
P-high Priority: High. A high-priority issue should be fixed as soon as possible.

Comments

@wks
Copy link
Collaborator

wks commented Oct 16, 2023

It is stupid to enqueue the address of each and every element of an array into a ProcessEdgesWork. We can enqueue slices directly.

For example, when scanning an Object[], instead of enqueuing &object[0], &object[1], &object[2], ..., &object[object.length - 1], we can enqueue one single OpenJDKEdgeRange { range: &object[0]..&object[object.length - 1] }. That saves both space and time.

But we need to take into account the effect of prefetching as well as eager edge loading (See: #584). If we decide that it is better to load edges eagerly when scanning the object, we may want to enqueue the edge address together with the value it holds. If that's the case, there will be no space advantage to enqueue slices because we need to enqueue values, too. But there may be a temporal advantage. If we know that consecutive edges in a ProcessEdgesWork work packet are loaded sequentially from an array, we may take advantage of it and do prefetching more efficiently.

@qinsoon qinsoon added the P-high Priority: High. A high-priority issue should be fixed as soon as possible. label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-high Priority: High. A high-priority issue should be fixed as soon as possible.
Projects
None yet
Development

No branches or pull requests

2 participants