Skip to content

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