Skip to content

perf(allocator): add #[inline(always)] to trivial RawVec methods#15470

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-08-perf_allocator_add_inline_always_to_trivial_rawvec_methods
Nov 8, 2025
Merged

perf(allocator): add #[inline(always)] to trivial RawVec methods#15470
graphite-app[bot] merged 1 commit intomainfrom
11-08-perf_allocator_add_inline_always_to_trivial_rawvec_methods

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 8, 2025

These methods are trivial, and should always be inlined. Probably compiler will anyway, but make sure by adding #[inline(always)] attributes, same as for RawVec's other trivial methods.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Nov 8, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@overlookmotel overlookmotel marked this pull request as ready for review November 8, 2025 11:31
Copilot AI review requested due to automatic review settings November 8, 2025 11:31
@overlookmotel overlookmotel self-assigned this Nov 8, 2025
@overlookmotel
Copy link
Member Author

Trivial change, so merging without review.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
Copy link
Member Author

overlookmotel commented Nov 8, 2025

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds inline attributes to several methods in RawVec and corrects documentation to accurately reflect the implementation. The changes improve performance by enabling aggressive inlining of simple accessor methods and constructor functions.

  • Adds #[inline(always)] to four simple methods: new_in, from_raw_parts_in, ptr, and bump
  • Adds #[inline] to the private current_layout method
  • Corrects documentation comment for ptr() method to reference NonNull::dangling() instead of the outdated Unique::empty()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…15470)

These methods are trivial, and should always be inlined. Probably compiler will anyway, but make sure by adding `#[inline(always)]` attributes, same as for `RawVec`'s other trivial methods.
@graphite-app graphite-app bot force-pushed the 11-08-perf_allocator_add_inline_always_to_trivial_rawvec_methods branch from 7de2fce to b6f3424 Compare November 8, 2025 11:35
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 8, 2025

CodSpeed Performance Report

Merging #15470 will not alter performance

Comparing 11-08-perf_allocator_add_inline_always_to_trivial_rawvec_methods (7de2fce) with main (732205e)

Summary

✅ 33 untouched
⏩ 4 skipped1

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@graphite-app graphite-app bot merged commit b6f3424 into main Nov 8, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 11-08-perf_allocator_add_inline_always_to_trivial_rawvec_methods branch November 8, 2025 11:41
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments