Mark NonNull read family and offset_from as inline(always) - #161004
Mark NonNull read family and offset_from as inline(always)#161004zakrad wants to merge 1 commit into
Conversation
read, read_volatile, read_unaligned, and offset_from are the only NonNull pointer methods still marked inline; the other 17 are inline(always), as are the raw const/mut pointer equivalents. They are one-line delegating wrappers, so make them consistent -- they now inline in debug like their siblings.
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Do you have any particular evidence this helps? I figure it probably does, but I could be wrong. |
The raw pointer funcs these wrap are #[inline(always)] #160816 NonNull read + offset_from left out, codegen wise the difference shows in debug, at -Copt-level=0 #[inline] stays an out of line call, while #[inline(always)] gets inlined, its not a release perf change but consistency plus tiny unoptimized codegen |
|
Right, I know what |
|
No evidence it does, it was mostly for consistency, we can have perf run tho |
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Mark NonNull read family and offset_from as inline(always)
|
@rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (0a988f7): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 456.919s -> 458.765s (0.40%) |
|
@rust-timer build 0a988f7 profiles=debug |
|
@bors try |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Mark NonNull read family and offset_from as inline(always)
|
@rust-timer build 93f964f profiles=debug |
|
Missing artifact for sha |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (5e7f312): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 1.8%, secondary 2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 11.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 456.919s -> 457.847s (0.20%) |
|
Unless you have any actual benchmarks to share I'm just going to close this tbh |
|
no benchmarks, fine to close |
View all comments
These are one line wrappers that just forward to the raw pointer funcs that are all
#[inline(always)], as are NonNull's ownwriteandoffset, Thereadandoffset_fromwere left as plain#[inline]