Skip to content

Genericize (try_)ref_from_prefix_suffix - #3711

Open
jswrenn wants to merge 1 commit into
Gfa0cb30780189c43bb84da57a9ade4d5a9754223from
Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c
Open

jswrenn wants to merge 1 commit into
Gfa0cb30780189c43bb84da57a9ade4d5a9754223from
Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c

Conversation

@jswrenn

@jswrenn jswrenn commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

...so that they consume an IntoBytes as their source. Since these
methods are private, this does not yet increase expressivity for
users, but nonetheless allows the compiler to better optimize existing
callsites. For example, the ref_from_prefix_dynamic_size benchmark
becomes branchless, shrinking from 14 to 9 instructions. The falible
suffix-with-elems benchmarks shrink from 24 to 17 instructions for
dynamic size, and 28 to 20 instructions for dynamic padding. Only
try_ref_from_prefix_dynamic_size regresses, from 19 to 20 instructions.


Latest Update: v3 — Compare vs v2

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v2 v1 Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c && git checkout -b pr-Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c FETCH_HEAD

Checkout

git fetch origin refs/heads/Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c

Stacked PRs enabled by GHerrit.

...so that they consume an `IntoBytes` as their source. Since these
methods are private, this does not yet increase expressivity for
users, but nonetheless allows the compiler to better optimize existing
callsites. For example, the `ref_from_prefix_dynamic_size` benchmark
becomes branchless, shrinking from 14 to 9 instructions. The falible
suffix-with-elems benchmarks shrink from 24 to 17 instructions for
dynamic size, and 28 to 20 instructions for dynamic padding. Only
`try_ref_from_prefix_dynamic_size` regresses, from 19 to 20 instructions.

gherrit-pr-id: Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c
@jswrenn
jswrenn force-pushed the Gd1b460a8ec2e8aa8adf2e070c329d9f209c7c89c branch from c4d31ee to 714c822 Compare September 22, 2026 16:44
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (6e57b73) to head (714c822).

Additional details and impacted files
@@                              Coverage Diff                              @@
##           Gfa0cb30780189c43bb84da57a9ade4d5a9754223    #3711      +/-   ##
=============================================================================
+ Coverage                                      92.20%   92.51%   +0.31%     
=============================================================================
  Files                                             20       20              
  Lines                                           6260     6362     +102     
=============================================================================
+ Hits                                            5772     5886     +114     
+ Misses                                           488      476      -12     

☔ View full report in Codecov by Harness.
📢 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.

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!!

This branch has not been deployed

No deployments
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