-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
avoid using an Arc for quiet_matched #141
Conversation
This makes it a little faster: from 19.60s user 0.28s system 377% cpu 5.267 total to 17.99s user 0.30s system 371% cpu 4.924 total
Yeah, I wouldn't expect this to make a difference. An Arc should only impose overhead when it's cloned, not when it's accessed. We only clone it once for each worker, which means the overhead is likely imperceptible. Can you explain more about your benchmark? |
I just use perf to see where it takes the most time.
then
and press a on the function that uses the most of time to see assembly. Not very easy to read, but there is a Today rg took more than one minute to complete a search, so I tried to find out why. The time reduced to several seconds when I built the new master. |
Profiles can be hard to read, and in this case, it is probably misleading you. The profile reveals a lot of time spent in the work queue because it is spinning waiting for work. That is, the directory iterator can't produce work fast enough for the search workers. The time reduction on master almost certainly means that the directory you're searching has a very large gitignore file. I implemented a crude stopgap measure to make this faster, but I'm still working on it. If I'm right, then you should notice a large improvement by running with the One way to extract a less confusing profile is to pass |
So there is a spinning lock? It makes my fan spin loudly....I prefer it to block instead. There is no gitignore file, though it's in a (huge) git repo---the "community" repo from Arch Linux. I take the source code outside the repo, and it's slow the same. With |
Could you please tell me how you're running your test? What command did you run to get the data? What
This is how lock free queues work. We should fix the producer. |
I run this in the
Does this mean that, if I search on slow disks, it takes a lot of CPU time to wait? |
Could you please tell me how to get the data you're searching? What command should I run?
No, it doesn't mean that. If the disks are slow and the corpora isn't memory, then the search workers will also be slower. |
Extract this tarball.
I see, thanks for the explanation :-) |
Could you show me how to get this data as well? And the (I'm asking because it looks like there's more going on here. The only difference between |
For |
Oh, I see! I used |
Indeed. On
(The counts are off because I'm pretty sure If we ask both tools to skip ignore files, then they both get a lot faster, but
The difference is almost entirely attributable to
|
@lilydjwg FYI, I made a few (important) edits to my previous comment. |
I'm sorry, the result isn't stable, and I can't tell whether it's faster or slower....