Skip to content

feat(vector): add index operations without bounds checks#963

Merged
vapourismo merged 1 commit intomainfrom
ole/push-qpnrppyyyzzk
Mar 30, 2026
Merged

feat(vector): add index operations without bounds checks#963
vapourismo merged 1 commit intomainfrom
ole/push-qpnrppyyyzzk

Conversation

@vapourismo
Copy link
Copy Markdown
Collaborator

@vapourismo vapourismo commented Mar 27, 2026

What

Adds two methods to the Vector state components:

  • index_unchecked
  • index_unchecked_mut

These two methods allow you to obtain references to the underlying elements without incurring the cost of a bounds check.

Why

These functions are important for the usage of this state component in performance critical contexts.
See #962 for usage of these methods.

Manually Testing

make all

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@vapourismo vapourismo marked this pull request as ready for review March 27, 2026 22:17
@vapourismo vapourismo enabled auto-merge March 27, 2026 22:17
@github-actions
Copy link
Copy Markdown

Benchmark results for revision 6994cb8:

Metric Duration TPS
Mean 1.520093416s 26.314
Worst 1.527196133s 26.192
Best 1.511172514s 26.470
Standard Deviation ±4.645999ms ±0.080
Full results
Run Transfers Duration TPS
1 40 1.52693015s 26.196
2 40 1.52415024s 26.244
3 40 1.527145634s 26.193
4 40 1.515689623s 26.391
5 40 1.516332663s 26.379
6 40 1.520083014s 26.314
7 40 1.511172514s 26.470
8 40 1.51738434s 26.361
9 40 1.521296641s 26.293
10 40 1.527048926s 26.194
11 40 1.512085967s 26.454
12 40 1.52197925s 26.282
13 40 1.517228748s 26.364
14 40 1.527196133s 26.192
15 40 1.516944s 26.369
16 40 1.519261533s 26.329
17 40 1.517786692s 26.354
18 40 1.519825054s 26.319
19 40 1.519773727s 26.320
20 40 1.522553477s 26.272

Compare the results above with those for the default branch.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.74%. Comparing base (9b1c76e) to head (5d706a2).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
data/src/components/vector.rs 0.00% 24 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #963      +/-   ##
==========================================
- Coverage   89.87%   89.74%   -0.14%     
==========================================
  Files         110      110              
  Lines       22084    22108      +24     
  Branches    22084    22108      +24     
==========================================
- Hits        19848    19840       -8     
- Misses       1837     1869      +32     
  Partials      399      399              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vapourismo vapourismo added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit f436502 Mar 30, 2026
9 of 10 checks passed
@vapourismo vapourismo deleted the ole/push-qpnrppyyyzzk branch March 30, 2026 07:06
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.

3 participants