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

Reduce default thread count #99

Merged
merged 1 commit into from
Mar 25, 2023
Merged

Reduce default thread count #99

merged 1 commit into from
Mar 25, 2023

Conversation

solidiquis
Copy link
Owner

@solidiquis solidiquis commented Mar 25, 2023

Setting default thread count to available_parallelism takes us way past the point of diminishing returns which is actually detrimental to performance.

3 seems to be the sweet spot I've found across various SSDs and HDDs.

For more information about how parallelism affects disk reads checkout this link.

┌─ code
└ 🧋 time et -l 1 -H -i -t 1 --no-config
code (125.46 GiB)
├─ ruby (32.87 KiB)
├─ advent_of_code (3.81 MiB)
├─ lua (21.02 KiB)
├─ homebrew-tap (33.93 KiB)
├─ rust (6.52 GiB)
├─ projects (118.94 GiB)
├─ test (25.55 KiB)
├─ .DS_Store (6.00 KiB)
└─ golf (2.30 KiB)

et -l 1 -H -i -t 1 --no-config  1.06s user 0.88s system 121% cpu 1.597 total
┌─ code
└ 🧋 time et -l 1 -H -i -t 2 --no-config
code (125.46 GiB)
├─ ruby (32.87 KiB)
├─ advent_of_code (3.81 MiB)
├─ lua (21.02 KiB)
├─ rust (6.52 GiB)
├─ homebrew-tap (33.93 KiB)
├─ projects (118.94 GiB)
├─ .DS_Store (6.00 KiB)
├─ test (25.55 KiB)
└─ golf (2.30 KiB)

et -l 1 -H -i -t 2 --no-config  1.03s user 1.02s system 209% cpu 0.979 total
┌─ code
└ 🧋 time et -l 1 -H -i -t 3 --no-config
code (125.46 GiB)
├─ ruby (32.87 KiB)
├─ advent_of_code (3.81 MiB)
├─ lua (21.02 KiB)
├─ homebrew-tap (33.93 KiB)
├─ projects (118.94 GiB)
├─ rust (6.52 GiB)
├─ test (25.55 KiB)
├─ .DS_Store (6.00 KiB)
└─ golf (2.30 KiB)

et -l 1 -H -i -t 3 --no-config  1.10s user 1.14s system 281% cpu 0.796 total
┌─ code
└ 🧋 time et -l 1 -H -i -t 4 --no-config
code (125.46 GiB)
├─ ruby (32.87 KiB)
├─ lua (21.02 KiB)
├─ advent_of_code (3.81 MiB)
├─ rust (6.52 GiB)
├─ homebrew-tap (33.93 KiB)
├─ projects (118.94 GiB)
├─ .DS_Store (6.00 KiB)
├─ golf (2.30 KiB)
└─ test (25.55 KiB)

et -l 1 -H -i -t 4 --no-config  1.19s user 1.61s system 339% cpu 0.828 total
┌─ code
└ 🧋 time et -l 1 -H -i -t 5 --no-config
code (125.46 GiB)
├─ ruby (32.87 KiB)
├─ advent_of_code (3.81 MiB)
├─ lua (21.02 KiB)
├─ homebrew-tap (33.93 KiB)
├─ rust (6.52 GiB)
├─ projects (118.94 GiB)
├─ test (25.55 KiB)
├─ .DS_Store (6.00 KiB)
└─ golf (2.30 KiB)

et -l 1 -H -i -t 5 --no-config  1.29s user 2.05s system 399% cpu 0.836 total
┌─ code
└ 🧋 time et -l 1 -H -i -t 6 --no-config
code (125.46 GiB)
├─ ruby (32.87 KiB)
├─ lua (21.02 KiB)
├─ rust (6.52 GiB)
├─ .DS_Store (6.00 KiB)
├─ homebrew-tap (33.93 KiB)
├─ advent_of_code (3.81 MiB)
├─ projects (118.94 GiB)
├─ test (25.55 KiB)
└─ golf (2.30 KiB)

et -l 1 -H -i -t 6 --no-config  1.35s user 2.56s system 463% cpu 0.844 total

@solidiquis solidiquis merged commit 82c192e into master Mar 25, 2023
@solidiquis solidiquis deleted the default-thread-count branch April 14, 2023 02:03
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