Skip to content

Improve performance of copy_set and copy_insert on Erlang#5

Merged
lunagl merged 2 commits intolunagl:mainfrom
gertvv:feature/fast_set
Apr 11, 2025
Merged

Improve performance of copy_set and copy_insert on Erlang#5
lunagl merged 2 commits intolunagl:mainfrom
gertvv:feature/fast_set

Conversation

@gertvv
Copy link
Contributor

@gertvv gertvv commented Apr 8, 2025

Applying the same technique of #3 to copy_set and copy_insert yields a meaningful performance gain for small arrays:

Before

Input               Function                       IPS           Min           P99
glearray: 10        set 1k elements         35282.8670        0.0239        0.0443
glearray: 100       set 1k elements         19480.9071        0.0388        0.1017
glearray: 1000      set 1k elements          2682.4007        0.3027        0.6363
glearray: 10k       set 1k elements           260.1347        3.5254        4.6076
glearray: 100k      set 1k elements            15.6756       60.7894       67.5147

After

Input               Function                       IPS           Min           P99
glearray: 10        set 1k elements         45325.3542        0.0185        0.0269
glearray: 100       set 1k elements         22104.3305        0.0361        0.0528
glearray: 1000      set 1k elements          2908.2394        0.3104        0.3869
glearray: 10k       set 1k elements           250.4258        3.6005        4.7467
glearray: 100k      set 1k elements             4.7084      208.5569      222.2722

Performance for the 100k size was really erratic, I have also seen it on par with the "before" result. It just runs too slow to get any meaningful results at all.

@lunagl
Copy link
Owner

lunagl commented Apr 11, 2025

Looks good, could you resolve the conflict so I can merge this?

@lunagl lunagl merged commit 99d49ef into lunagl:main Apr 11, 2025
1 check passed
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