Skip to content

Apply #[inline(always)] to more closures#3140

Merged
jswrenn merged 1 commit into
mainfrom
Gff0fac1332c8d87cd462e82e44fa573fb6678db3
Mar 19, 2026
Merged

Apply #[inline(always)] to more closures#3140
jswrenn merged 1 commit into
mainfrom
Gff0fac1332c8d87cd462e82e44fa573fb6678db3

Conversation

@jswrenn

@jswrenn jswrenn commented Mar 19, 2026

Copy link
Copy Markdown
Collaborator

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/Gff0fac1332c8d87cd462e82e44fa573fb6678db3 && git checkout -b pr-Gff0fac1332c8d87cd462e82e44fa573fb6678db3 FETCH_HEAD

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gff0fac1332c8d87cd462e82e44fa573fb6678db3

Stacked PRs enabled by GHerrit.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces targeted performance optimizations by explicitly instructing the Rust compiler to always inline specific closures and a method. The goal is to reduce call overhead and potentially enable further compiler optimizations at the call sites. The accompanying benchmark results have been updated to reflect the performance characteristics of these changes, providing insight into their impact on instruction count, cycle count, and overall throughput.

Highlights

  • Performance Optimization: Applied the #[inline(always)] attribute to several closures and one method across various Rust source files to encourage the compiler to inline these code paths, aiming for potential performance improvements by reducing function call overhead.
  • Benchmark Updates: Updated the ref_from_bytes_static_size benchmark files (.x86-64 and .x86-64.mca) to reflect the impact of the inlining changes on instruction count, total cycles, uOps, and Instructions Per Cycle (IPC).
  • Code Structure: The changes are primarily focused on adding the #[inline(always)] attribute, which involves minor code formatting adjustments to accommodate the attribute placement for closures.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov-commenter

codecov-commenter commented Mar 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.85%. Comparing base (a6a530d) to head (6fd04a1).

Files with missing lines Patch % Lines
src/ref.rs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3140      +/-   ##
==========================================
- Coverage   91.87%   91.85%   -0.02%     
==========================================
  Files          20       20              
  Lines        6057     6067      +10     
==========================================
+ Hits         5565     5573       +8     
- Misses        492      494       +2     

☔ 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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting /gemini review.

@jswrenn jswrenn force-pushed the Gff0fac1332c8d87cd462e82e44fa573fb6678db3 branch from 837a971 to 677e3de Compare March 19, 2026 17:59
@jswrenn jswrenn requested a review from joshlf March 19, 2026 18:02
@jswrenn jswrenn enabled auto-merge March 19, 2026 18:14
gherrit-pr-id: Gff0fac1332c8d87cd462e82e44fa573fb6678db3
@jswrenn jswrenn force-pushed the Gff0fac1332c8d87cd462e82e44fa573fb6678db3 branch from 677e3de to 6fd04a1 Compare March 19, 2026 18:14
@jswrenn jswrenn added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 0406c5c Mar 19, 2026
108 checks passed
@jswrenn jswrenn deleted the Gff0fac1332c8d87cd462e82e44fa573fb6678db3 branch March 19, 2026 18:56
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