-
Notifications
You must be signed in to change notification settings - Fork 0
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
c: option to use mmap when given a file name #2
Open
rmg
wants to merge
3
commits into
master
Choose a base branch
from
mmap-maybe
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
|
Not sure if that is interesting... I think its just showing that when using mmap, data comes from page faults, and it doesn't when using read(2), that version would show higher syscall:read counts instead. |
More performance tuning that theoretically helps but doesn't seem to move the needle.
In theory this makes certain operations more efficient.
mmap() is supposed to be fast, right? Turns out we skip so aggressively that the overhead of the extra book keeping and round-tripping with the kernel that comes with mmap actually ends up costing us more than any gains. This is somewhat surprising given that mmap() ends up being a slight performance boost for ripgrep when dealing with large input files and that's the specific case I tested with. What I suspect is happening is that we are skipping so aggressively that the OS hasn't been able to read the next page for us by the time we finish with the current one.
I see you're clearing the cache for these. Do the results look much different when the cache is warm? I know the wall clock times are a similar ratio when the cache is warm. |
|
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.
mmap() is supposed to be fast, right? Turns out we skip so aggressively
that the overhead of the extra book keeping and round-tripping with the
kernel that comes with mmap actually ends up costing us more than any
gains.
This is somewhat surprising given that mmap() ends up being a slight
performance boost for ripgrep when dealing with large input files and
that's the specific case I tested with. What I suspect is happening is
that we are skipping so aggressively that the OS hasn't been able to
read the next page for us by the time we finish with the current one.