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

perf: move to filter map from map and filter #65

Merged
merged 1 commit into from
Dec 2, 2023
Merged

Conversation

AdeAttwood
Copy link
Owner

Instead of doing two passes of all candidates using map then a filter, this uses filter_map so we are only doing one pass for the candidates. This alone is quite a significant improvement of around 7%

Output of ./scripts/bench 0.x

Benchmark 1: 0.x
  Time (mean ± σ):      2.373 s ±  0.138 s    [User: 10.617 s, System: 1.697 s]
  Range (min … max):    2.124 s …  2.577 s    10 runs

Benchmark 2: HEAD
  Time (mean ± σ):      2.206 s ±  0.133 s    [User: 10.061 s, System: 1.811 s]
  Range (min … max):    1.940 s …  2.433 s    10 runs

Summary
  HEAD ran
    1.08 ± 0.09 times faster than 0.x

-------------------------------------
The percentage difference is -7.00%
-------------------------------------

Instead of doing two passes of all candidates using map then a filter,
this uses `filter_map` so we are only doing one pass for the candidates.
This alone is quite a significant improvement of ~7%

Output of `./scripts/bench 0.x`

Benchmark 1: 0.x
  Time (mean ± σ):      2.373 s ±  0.138 s    [User: 10.617 s, System: 1.697 s]
  Range (min … max):    2.124 s …  2.577 s    10 runs

Benchmark 2: HEAD
  Time (mean ± σ):      2.206 s ±  0.133 s    [User: 10.061 s, System: 1.811 s]
  Range (min … max):    1.940 s …  2.433 s    10 runs

Summary
  HEAD ran
    1.08 ± 0.09 times faster than 0.x

-------------------------------------
The percentage difference is -7.00%
-------------------------------------
@AdeAttwood AdeAttwood merged commit 2429fe7 into 0.x Dec 2, 2023
5 checks passed
@AdeAttwood AdeAttwood deleted the reduce-loops branch December 2, 2023 17:27
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