Skip to content

Does parallelism actually improve performance when doing file-system traversal? #2472

Answered by BurntSushi
solidiquis asked this question in Q&A
Discussion options

You must be logged in to vote

I'm somewhat confused here. Your narrative suggests that your program gets slower as the thread count increases, but your data suggests something more interesting that. If I'm reading what you've posted correctly, your run with 1 thread takes ~1.4s, a run with 4 threads takes 0.8s and a run with 8 threads takes 1s. So both 4 and 8 threads are faster than 1 thread, but 4 threads is faster than 8 threads. To me, that suggest parallelism helps quite a bit. Your run with 4 threads gives you an almost 2x improvement!

But let's see what it looks like in the context of ripgrep:

$ git remote -v
origin  git@github.com:nwjs/chromium.src (fetch)
origin  git@github.com:nwjs/chromium.src (push)

$ git…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@solidiquis
Comment options

@manikantag
Comment options

Answer selected by solidiquis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants