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

Basic parallelism machinery #195

Merged
merged 5 commits into from
Dec 7, 2024
Merged

Basic parallelism machinery #195

merged 5 commits into from
Dec 7, 2024

Conversation

sampsyo
Copy link
Collaborator

@sampsyo sampsyo commented Dec 7, 2024

Baby's first Rayon experiment. I tried parallelizing the basic memchr iteration—not for anything important, just for a really basic wc -l (text-file line count) implementation. fgfa bench --wcl foo.txt should count the number of lines in the file. This is just a demo to see what it could do; it is not actually useful.

Anyway, the perf results are confusing, at the moment. On my MacBook Pro, wc -l itself takes 8.0 seconds to process the big Arabidopsis GAF; the sequential line counter takes 8.7 seconds (seems about right), and the parallel version takes 0.25 seconds (seems way too fast). (They all get the same answer.) This does not make much sense; why would the parallel version be 35 times faster? It's only a 10-core machine. Is it MLP, maybe? Weird effects of splitting up the memchr work into smaller chunks? It's a mystery. I guess I will try applying this to the actual GAF parser next to see what happens.

So I can play around with parser parallelization. On my desktop, this
simple thing is actually a little faster than coreutils wc (4.76 sec vs.
4.21 sec to process the arabidopsis GAF).
@sampsyo sampsyo merged commit a84e029 into main Dec 7, 2024
12 checks passed
@sampsyo sampsyo deleted the parallel branch December 7, 2024 23:42
sampsyo added a commit that referenced this pull request Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant