perf(allocator/vec2): calling Bump::grow or Bump::shrink at the call site directly instead of calling realloc#10686
Merged
graphite-app[bot] merged 1 commit intomainfrom May 3, 2025
Conversation
This was referenced Apr 29, 2025
perf(allocator/vec2): replace
self.reserve(1) calls with self.grow_one() for better efficiency
#9856
Merged
Member
Author
Bump::grow or Bump::shrink at the call site directlyBump::growor Bump::shrink at the call site directly
CodSpeed Instrumentation Performance ReportMerging #10686 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
2252ad9 to
1737415
Compare
Bump::growor Bump::shrink at the call site directlyBump::grow or Bump::shrink at the call site directly
d753000 to
58393b8
Compare
Bump::grow or Bump::shrink at the call site directlyBump::grow or Bump::shrink at the call site directly instead of calling realloc
c70f032 to
04757c5
Compare
58393b8 to
50aaab5
Compare
04757c5 to
b56f8e1
Compare
50aaab5 to
cdb5487
Compare
b56f8e1 to
4682891
Compare
cdb5487 to
c9bfd21
Compare
overlookmotel
approved these changes
May 3, 2025
Member
Merge activity
|
…all site directly instead of calling `realloc` (#10686) This PR aims to remove the `realloc` method, which was copied from `bumpalo`. The `realloc` function is used to call the `shrink` or `grow` method of bumpalo by checking the new size. This is unnecessary because in the call site, we know which method we should call, and the ZST check is also unnecessary because it has been checked earlier in the call site. Also, this is aligned with the standard library implementation.
4682891 to
b4953b4
Compare
c9bfd21 to
2dc4779
Compare
Base automatically changed from
04-28-perf_allocator_vec2_resolve_performance_regression_for_extend
to
main
May 3, 2025 13:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR aims to remove the
reallocmethod, which was copied frombumpalo. Thereallocfunction is used to call theshrinkorgrowmethod of bumpalo by checking the new size. This is unnecessary because in the call site, we know which method we should call, and the ZST check is also unnecessary because it has been checked earlier in the call site.Also, this is aligned with the standard library implementation.