-
Notifications
You must be signed in to change notification settings - Fork 0
Add on-disk binary search benchmark #3
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
base: main
Are you sure you want to change the base?
Conversation
…with" This reverts commit 0455261.
d036a8b to
1880417
Compare
1880417 to
b345a7e
Compare
| let reference = unsafe { s.get_unchecked(mid) }; | ||
| yield prefetch(reference); | ||
| yield mid; |
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.
Why are you doing a s.get_unchecked(mid) before yielding mid to be prefetched by the kernel ? wouldn't this touch the memory twice ?
[edit]: I tried timing the in_memory benchmark swapping the order of yield mid with let reference = .. and it was a lot slower contrary to my expectations 🧐 why is this the case?
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.
What get_unchecked is just an offset on top of a pointer, giving you a reference. I return mid to be prefetched later and the reference is dereferenced (read) just after the yield. The memory access (load of page) is done when we dereferenced to read the value. I don't know exactly why inverting the yield and get_reference is slower though 🤔
No description provided.