fix(benchmarks): add upper/lower values to BMF throughput
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 2 Oct 2024 16:07:13 +0000 (18:07 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 2 Oct 2024 16:07:13 +0000 (18:07 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
benchmarks/benchmarks-utils.mjs

index 6c3d0d820dadb5abb4ab58737d44afeb5959f8f0..8ba93ae73a5f6ddd07ec1d56d293a1839b5b2d30 100644 (file)
@@ -141,6 +141,8 @@ export const runPoolifierBenchmarkTatamiNg = async (
 export const convertTatamiNgToBmf = report => {
   return report.benchmarks
     .map(({ name, stats }) => {
+      // https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae
+      const throughputSd = (1e9 * stats?.sd) / stats?.avg ** 2
       return {
         [name]: {
           latency: {
@@ -149,6 +151,8 @@ export const convertTatamiNgToBmf = report => {
             value: stats?.avg,
           },
           throughput: {
+            lower_value: stats?.iters - throughputSd,
+            upper_value: stats?.iters + throughputSd,
             value: stats?.iters,
           },
         },