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

Added go concurrency alternative #8

Merged
merged 6 commits into from
Sep 24, 2023
Merged

Added go concurrency alternative #8

merged 6 commits into from
Sep 24, 2023

Conversation

DrBlury
Copy link
Contributor

@DrBlury DrBlury commented Sep 23, 2023

No description provided.

@jinyus
Copy link
Owner

jinyus commented Sep 23, 2023

Hey, did you get a speed up from this solution? It's a tad slower for me. Higher user/sys time so the scheduler might be pure overhead in this case.

Multi-threaded:

Benchmark 1: ./related_concurrent
Processing time (w/o IO) 38.156536ms
Processing time (w/o IO) 38.618053ms
Processing time (w/o IO) 40.061199ms
Processing time (w/o IO) 35.173302ms
Processing time (w/o IO) 40.124267ms
Processing time (w/o IO) 37.642429ms
Processing time (w/o IO) 41.555819ms
Processing time (w/o IO) 36.540949ms
Processing time (w/o IO) 38.355726ms
Processing time (w/o IO) 42.252774ms
  Time (mean ± σ):      64.0 ms ±   3.9 ms    [User: 138.4 ms, System: 191.3 ms]
  Range (min … max):    57.5 ms …  69.5 ms    10 runs

Single threaded:

Benchmark 1: ./related
Processing time (w/o IO) 34.768789ms
Processing time (w/o IO) 33.876765ms
Processing time (w/o IO) 34.032793ms
Processing time (w/o IO) 33.77333ms
Processing time (w/o IO) 32.963022ms
Processing time (w/o IO) 34.152432ms
Processing time (w/o IO) 34.022177ms
Processing time (w/o IO) 34.341914ms
Processing time (w/o IO) 33.110598ms
Processing time (w/o IO) 33.441999ms
  Time (mean ± σ):      56.4 ms ±   3.0 ms    [User: 51.3 ms, System: 13.4 ms]
  Range (min … max):    54.0 ms …  64.4 ms    10 runs

@DrBlury
Copy link
Contributor Author

DrBlury commented Sep 23, 2023

Yes I got it faster.

Benchmark 1: ./related
Time (mean ± σ):      52.2 ms ±   3.1 ms    [User: 49.3 ms, System: 5.4 ms]
Range (min … max):    48.2 ms …  56.4 ms    10 runs
Benchmark 1: ./related_concurrent
Time (mean ± σ):      41.0 ms ±   2.3 ms    [User: 91.7 ms, System: 30.4 ms]
Range (min … max):    37.8 ms …  44.6 ms    10 runs

@Mxrk
Copy link
Contributor

Mxrk commented Sep 23, 2023

❯ hyperfine -r 5 --show-output ./related
Benchmark 1: ./related
Processing time (w/o IO) 36.196708ms
Processing time (w/o IO) 33.582375ms
Processing time (w/o IO) 36.33625ms
Processing time (w/o IO) 37.070208ms
Processing time (w/o IO) 32.997792ms
  Time (mean ± σ):      52.2 ms ±   4.8 ms    [User: 48.4 ms, System: 4.8 ms]
  Range (min … max):    46.3 ms …  57.5 ms    5 runs
❯ hyperfine -r 5 --show-output ./related_concurrent
Benchmark 1: ./related_concurrent
Processing time (w/o IO) 43.314125ms
Processing time (w/o IO) 27.138375ms
Processing time (w/o IO) 28.395834ms
Processing time (w/o IO) 25.797833ms
Processing time (w/o IO) 28.685125ms
Time (mean ± σ):      91.7 ms ± 110.2 ms    [User: 108.0 ms, System: 35.6 ms]
Range (min … max):    39.1 ms … 288.8 ms    5 runs

@DrBlury
Copy link
Contributor Author

DrBlury commented Sep 23, 2023

I added a few warmups to even the playing field with cache stuff.

@jinyus jinyus merged commit 6e1d5a7 into jinyus:main Sep 24, 2023
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.

None yet

3 participants