Skip to content

chore: use std::hint::black_box #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged

Conversation

DaniPopes
Copy link
Contributor

It has been stable for quite a while now.

@DaniPopes DaniPopes force-pushed the std-black-box branch 3 times, most recently from 3a761fe to 1763484 Compare May 26, 2025 17:19
@DaniPopes DaniPopes changed the title Use std::hint::black_box chore: use std::hint::black_box May 26, 2025
Copy link

codspeed-hq bot commented Jun 16, 2025

CodSpeed Instrumentation Performance Report

Merging #97 will degrade performances by 18.88%

Comparing DaniPopes:std-black-box (6178dd1) with main (6cb8d30)

Summary

⚡ 5 improvements
❌ 7 regressions
✅ 155 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
a 254.7 ns 281.4 ns -9.48%
a 254.7 ns 281.4 ns -9.48%
fibo_iterative 126.7 ns 156.1 ns -18.86%
sum_fold 254.4 ns 283.9 ns -10.37%
sleep_100ms 566.1 ns 536.9 ns +5.43%
sleep_10ms 566.1 ns 536.9 ns +5.43%
sleep_50ms 566.1 ns 536.9 ns +5.43%
from_elem[1024] 1.9 µs 1.8 µs +3.27%
from_elem_decimal[1024] 1.9 µs 1.8 µs +3.27%
bench_array1[4] 125.3 ns 154.4 ns -18.88%
bench_array2[4] 125.3 ns 154.4 ns -18.88%
init_array[4] 125.3 ns 154.4 ns -18.88%

Copy link

codspeed-hq bot commented Jun 16, 2025

CodSpeed WallTime Performance Report

Merging #97 will degrade performances by 64.26%

Comparing DaniPopes:std-black-box (6178dd1) with main (6cb8d30)

Summary

⚡ 8 improvements
❌ 7 regressions
✅ 139 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
build_vec 215 ns 202 ns +6.44%
large_drop 172.7 µs 180.1 µs -4.12%
large_setup 12 ns 10 ns +20%
from_elem[1024] 82 ns 79 ns +3.8%
from_elem[2048] 248 ns 261 ns -4.98%
from_elem_decimal[1024] 82 ns 79 ns +3.8%
from_elem_decimal[2048] 256 ns 244 ns +4.92%
recursive_memoized[BTreeMap<u64, u64>, 0] 17 ns 14 ns +21.43%
hamiltonian_cycle[5] 663 ns 696 ns -4.74%
permutations[5] 10.8 µs 11.4 µs -5.37%
permutations[7] 760.5 µs 797.1 µs -4.59%
sleep_100ns 17.6 µs 49.2 µs -64.26%
sleep_100us 121.4 µs 133.1 µs -8.82%
sleep_1ns 40.1 µs 37.4 µs +7.42%
sleep_1us 58.4 µs 34.8 µs +67.69%

@art049 art049 requested a review from not-matthias June 27, 2025 13:37
It has been stable for quite a while now.
Copy link
Member

@not-matthias not-matthias left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @DaniPopes

@art049 art049 merged commit 6178dd1 into CodSpeedHQ:main Jun 27, 2025
12 of 13 checks passed
@DaniPopes DaniPopes deleted the std-black-box branch July 5, 2025 19:19
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