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

Slotted enumeration faster #381

Merged
merged 3 commits into from
Aug 9, 2024
Merged

Slotted enumeration faster #381

merged 3 commits into from
Aug 9, 2024

Conversation

Scooletz
Copy link
Contributor

@Scooletz Scooletz commented Aug 9, 2024

This PR introduces two changes to enumeration over SlottedArray:

  1. EnumerateAll that enumerates now with a bit less overhead (code size reduction and some inlines)
  2. EnumerateNibble that uses the new encoding of length to to leverage the filtering and returns data without having their keys unprepared if not needed. It's not 16 faster, but gives ~3x performance boost for scans.

Benchmarks

For EnumerateAll the existing one is used. For EnumerateNibble new benchmarks were added as previously it was filtering over the materialized key which was not different from EnumerateAll.

Before

Method Mean Error StdDev Code Size
EnumerateAll 751.6 ns 7.62 ns 6.75 ns 1,913 B

After

Method nibble Mean Error StdDev Code Size
EnumerateAll ? 744.7 ns 8.57 ns 8.01 ns 1,883 B
EnumerateNibble 0 239.3 ns 2.72 ns 2.54 ns 1,939 B
EnumerateNibble 1 241.3 ns 4.42 ns 4.14 ns 1,932 B

@Scooletz Scooletz added the 🐌 performance Perofrmance related issue label Aug 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

Code Coverage

Package Line Rate Branch Rate Health
Paprika 85% 79%
Summary 85% (4307 / 5088) 79% (1353 / 1723)

Minimum allowed line rate is 75%

@Scooletz Scooletz marked this pull request as ready for review August 9, 2024 11:46
@Scooletz Scooletz merged commit 5feb4c7 into main Aug 9, 2024
4 checks passed
@Scooletz Scooletz deleted the slotted-enumeration-faster branch August 9, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐌 performance Perofrmance related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant