@@ -34,7 +34,7 @@ int main(int argc, char** argv) {
3434 };
3535
3636 // Benchmark ranges::{find_last,find_last_if,find_last_if_not} where the last element
37- // is found 25 % into the sequence
37+ // is found 10 % into the sequence
3838 {
3939 auto bm = []<class Container >(std::string name, auto find_last) {
4040 benchmark::RegisterBenchmark (
@@ -46,8 +46,8 @@ int main(int argc, char** argv) {
4646 ValueType y = random_different_from ({x});
4747 Container c (size, x);
4848
49- // put the element we're searching for at 25 % of the sequence
50- *std::next (c.begin (), size / 4 ) = y;
49+ // put the element we're searching for at 10 % of the sequence
50+ *std::next (c.begin (), size / 10 ) = y;
5151
5252 for ([[maybe_unused]] auto _ : st) {
5353 benchmark::DoNotOptimize (c);
@@ -64,26 +64,26 @@ int main(int argc, char** argv) {
6464 };
6565
6666 // find_last
67- bm.operator ()<std::vector<char >>(" rng::find_last(vector<char>) (bail 25 %)" , std::ranges::find_last);
68- bm.operator ()<std::vector<int >>(" rng::find_last(vector<int>) (bail 25 %)" , std::ranges::find_last);
69- bm.operator ()<std::deque<int >>(" rng::find_last(deque<int>) (bail 25 %)" , std::ranges::find_last);
70- bm.operator ()<std::list<int >>(" rng::find_last(list<int>) (bail 25 %)" , std::ranges::find_last);
71- bm.operator ()<std::forward_list<int >>(" rng::find_last(forward_list<int>) (bail 25 %)" , std::ranges::find_last);
67+ bm.operator ()<std::vector<char >>(" rng::find_last(vector<char>) (bail 10 %)" , std::ranges::find_last);
68+ bm.operator ()<std::vector<int >>(" rng::find_last(vector<int>) (bail 10 %)" , std::ranges::find_last);
69+ bm.operator ()<std::deque<int >>(" rng::find_last(deque<int>) (bail 10 %)" , std::ranges::find_last);
70+ bm.operator ()<std::list<int >>(" rng::find_last(list<int>) (bail 10 %)" , std::ranges::find_last);
71+ bm.operator ()<std::forward_list<int >>(" rng::find_last(forward_list<int>) (bail 10 %)" , std::ranges::find_last);
7272
7373 // find_last_if
74- bm.operator ()<std::vector<char >>(" rng::find_last_if(vector<char>) (bail 25 %)" , ranges_find_last_if);
75- bm.operator ()<std::vector<int >>(" rng::find_last_if(vector<int>) (bail 25 %)" , ranges_find_last_if);
76- bm.operator ()<std::deque<int >>(" rng::find_last_if(deque<int>) (bail 25 %)" , ranges_find_last_if);
77- bm.operator ()<std::list<int >>(" rng::find_last_if(list<int>) (bail 25 %)" , ranges_find_last_if);
78- bm.operator ()<std::forward_list<int >>(" rng::find_last_if(forward_list<int>) (bail 25 %)" , ranges_find_last_if);
74+ bm.operator ()<std::vector<char >>(" rng::find_last_if(vector<char>) (bail 10 %)" , ranges_find_last_if);
75+ bm.operator ()<std::vector<int >>(" rng::find_last_if(vector<int>) (bail 10 %)" , ranges_find_last_if);
76+ bm.operator ()<std::deque<int >>(" rng::find_last_if(deque<int>) (bail 10 %)" , ranges_find_last_if);
77+ bm.operator ()<std::list<int >>(" rng::find_last_if(list<int>) (bail 10 %)" , ranges_find_last_if);
78+ bm.operator ()<std::forward_list<int >>(" rng::find_last_if(forward_list<int>) (bail 10 %)" , ranges_find_last_if);
7979
8080 // find_last_if_not
81- bm.operator ()<std::vector<char >>(" rng::find_last_if_not(vector<char>) (bail 25 %)" , ranges_find_last_if_not);
82- bm.operator ()<std::vector<int >>(" rng::find_last_if_not(vector<int>) (bail 25 %)" , ranges_find_last_if_not);
83- bm.operator ()<std::deque<int >>(" rng::find_last_if_not(deque<int>) (bail 25 %)" , ranges_find_last_if_not);
84- bm.operator ()<std::list<int >>(" rng::find_last_if_not(list<int>) (bail 25 %)" , ranges_find_last_if_not);
81+ bm.operator ()<std::vector<char >>(" rng::find_last_if_not(vector<char>) (bail 10 %)" , ranges_find_last_if_not);
82+ bm.operator ()<std::vector<int >>(" rng::find_last_if_not(vector<int>) (bail 10 %)" , ranges_find_last_if_not);
83+ bm.operator ()<std::deque<int >>(" rng::find_last_if_not(deque<int>) (bail 10 %)" , ranges_find_last_if_not);
84+ bm.operator ()<std::list<int >>(" rng::find_last_if_not(list<int>) (bail 10 %)" , ranges_find_last_if_not);
8585 bm.operator ()<std::forward_list<int >>(
86- " rng::find_last_if_not(forward_list<int>) (bail 25 %)" , ranges_find_last_if_not);
86+ " rng::find_last_if_not(forward_list<int>) (bail 10 %)" , ranges_find_last_if_not);
8787 }
8888
8989 // Benchmark ranges::{find_last,find_last_if,find_last_if_not} where the last element
@@ -100,7 +100,7 @@ int main(int argc, char** argv) {
100100 Container c (size, x);
101101
102102 // put the element we're searching for at 90% of the sequence
103- *std::next (c.begin (), 9 * ( size / 10 ) ) = y;
103+ *std::next (c.begin (), ( 9 * size) / 10 ) = y;
104104
105105 for ([[maybe_unused]] auto _ : st) {
106106 benchmark::DoNotOptimize (c);
0 commit comments