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

Use a single fold for difference #64

Merged
merged 2 commits into from
Oct 31, 2022
Merged

Use a single fold for difference #64

merged 2 commits into from
Oct 31, 2022

Conversation

JordanMartinez
Copy link
Contributor

@JordanMartinez JordanMartinez commented Jun 2, 2022

Description of the change

Uses a single fold for difference rather than folding over m2 once to produce a list and then folding over that list a second time to do the deletion.

Benchmark below:

Map
===
difference
---------------
Map2a0bff.difference: small map (100)
mean   = 17.89 ms
stddev = 1.37 ms
min    = 16.17 ms
max    = 40.21 ms
M.difference: small map (100)
mean   = 2.43 ms
stddev = 921.62 μs
min    = 1.84 ms
max    = 18.75 ms
Map2a0bff.difference: midsize map (10000)
mean   = 54.24 ms
stddev = 939.99 μs
min    = 53.27 ms
max    = 57.81 ms
M.difference: midsize map (10000)
mean   = 32.48 ms
stddev = 6.42 ms
min    = 24.70 ms
max    = 50.55 ms
Map2a0bff.difference: big map (1000000)
mean   = 65.23 ms
stddev = 3.98 ms
min    = 60.30 ms
max    = 72.10 ms
M.difference: big map (1000000)
mean   = 48.51 ms
stddev = 4.39 ms
min    = 45.34 ms
max    = 60.00 ms

Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@JordanMartinez JordanMartinez merged commit f149d50 into purescript:master Oct 31, 2022
@JordanMartinez JordanMartinez deleted the speed-up-differences branch October 31, 2022 15:43
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.

2 participants