Skip to content

Conversation

paulhauner
Copy link
Member

Adds special implementations of VariableList and FixedVector to optimise for the u8 type.

For reference: sigp/lighthouse#7952 (comment)

TODO

Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 51.21951% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.35%. Comparing base (3f3d7de) to head (5ab7494).

Files with missing lines Patch % Lines
src/variable_list_u8.rs 50.00% 31 Missing ⚠️
src/fixed_vector_u8.rs 52.45% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
- Coverage   58.62%   58.35%   -0.27%     
==========================================
  Files           8       10       +2     
  Lines         290      413     +123     
==========================================
+ Hits          170      241      +71     
- Misses        120      172      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@michaelsproul
Copy link
Member

I think we can close this in favour of my PR, if we are happy with introducing a small amount of unsafe code:

@michaelsproul
Copy link
Member

Performance-wise, the specialised type and the optimisation within the generic type are now equivalent (around 18us on my machine for 1M u8s). There were some kinks in the benchmarks that I had to iron out: with smaller lists and less warm-up time, the benchmark running first would run in 30us, and the one running second would run in 2us! The latest commit doesn't have this problem.

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