tests: perf: future_util: consider range size
tests: perf: future_util: consider range size

To compare apples to apples, we want to normalize
the perf results per parallel_for_each inner-loop.
Since parallel_dor_each runs over a vector of 100
elements int the `immediate` and `suspend` cases,
return this number so each invocation of the
test function will be counted as 100 iterations.

Since dividing the metrics by the number of inner-loops
amortizes the per-call overhead over this number,
seperate the range cases (`immediate` and `suspend`)
into several ranges consisting of: 1, 2, 10, and 100
elements each.

Ideally, in the future we can automatically call
a test case with various counts, perform a linear regression
over the results and derive the constant, per-call
overhead and the variable, per-element marginal cost.

For reference, here's how this change
affects future_util_perf results.

Before:

single run iterations:    0
single run duration:      1.000s
number of runs:           5
number of cores:          1
random seed:              2595382159

test                                      iterations      median         mad         min         max      allocs       tasks        inst
parallel_for_each.empty                    443973416     2.249ns     0.007ns     2.203ns     2.263ns       0.000       0.000        14.0
parallel_for_each.immediate                  3449205   290.363ns     0.023ns   290.255ns   290.516ns       0.000       0.001      1881.2
parallel_for_each.suspend                     201786     4.948us     3.172ns     4.945us     4.954us     109.000     102.000     33824.3

After:

random seed:              442818554

test                                      iterations      median         mad         min         max      allocs       tasks        inst
parallel_for_each.empty                    451186772     2.217ns     0.004ns     2.212ns     2.280ns       0.000       0.000        14.0
parallel_for_each.immediate_1               51647467    19.284ns     0.004ns    19.280ns    19.292ns       0.000       0.000       160.1
parallel_for_each.immediate_2               96803702    10.331ns     0.002ns    10.326ns    10.336ns       0.000       0.000        89.0
parallel_for_each.immediate_10             226870410     4.392ns     0.006ns     4.383ns     4.574ns       0.000       0.000        32.2
parallel_for_each.immediate_100            334167372     2.993ns     0.001ns     2.992ns     3.008ns       0.000       0.000        19.5
parallel_for_each.suspend_1                  4726161   202.823ns     0.296ns   202.476ns   203.433ns       5.000       5.000      1519.8
parallel_for_each.suspend_2                  7655616   130.925ns     0.138ns   130.635ns   131.155ns       3.500       3.000      1002.0
parallel_for_each.suspend_10                14269210    70.191ns     0.236ns    69.933ns    71.661ns       1.800       1.400       512.5
parallel_for_each.suspend_100               21947211    45.506ns     0.064ns    45.442ns    46.126ns       1.111       1.040       344.7

Signed-off-by: Benny Halevy <23c997c90eb8537635e9392d48e7af1bf1b2ca22@scylladb.com>

avikivity/seastar,syuu1228/seastar,avikivity/seastar,avikivity/seastar,syuu1228/seastar,scylladb/seastar,syuu1228/seastar,scylladb/seastar,scylladb/seastar