You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Obviously, the performance improvement is highly dependant on what data
you're using, whether YJIT is enabled, etc. I saw results ranging from
1.7x faster to 2.6x faster. The benchmark script is included.
For a benchmark run using sets with 10k members:
```
new impl 79.061 (± 8.9%) i/s (12.65 ms/i) - 392.000 in 5.004322s
old impl 32.736 (±15.3%) i/s (30.55 ms/i) - 162.000 in 5.052839s
```
The old implementation was ~2.42x slower.
For a benchmark run using very sparse sets with 100 members:
```
new impl 4.295k (±13.5%) i/s (232.81 μs/i) - 21.476k in 5.102536s
old impl 2.459k (±11.3%) i/s (406.69 μs/i) - 12.095k in 5.000148s
```
This time, the old implementation was ~1.75x slower.
I have some other (much bigger) PRs that should give even bigger
performance improvements, but this is simple and effective.
0 commit comments