# HG changeset patch
# User Raphaël Gomès <rgomes@octobus.net>
# Date 1679568313 -3600
#      Thu Mar 23 11:45:13 2023 +0100
# Node ID 69b77b941e7f2abd3e3d07f95f0798ae79f89365
# Parent  9bddb77a13bcc295b9cdf71904757b5ac399b5d4
# EXP-Topic benchmarks.status
benchmarks: add dimension for the number of threads

This is a very useful metric to test.

diff --git a/suites/hg/benchmarks/status.pbd b/suites/hg/benchmarks/status.pbd
--- a/suites/hg/benchmarks/status.pbd
+++ b/suites/hg/benchmarks/status.pbd
@@ -7,7 +7,7 @@
 copy-data-env = false
 
 [simple-command]
-command = "hg status"
+command = "RAYON_NUM_THREADS=$THREADS hg status"
 
 [simple-command.variants.dimensions.list-copies.no]
 default = true
@@ -53,3 +53,32 @@
 
 [simple-command.variants.dimensions.repo-state.all-and-large-ignored]
 cwd = "DATA-VARS:mercurial.working-copy.all-and-large-ignored"
+
+# TODO constraint the runner to only run benchmarks if they have enough cores
+[simple-command.variants.dimensions.threads.all]
+default = true
+# A bug in the code forced the thread count to 16
+constraints.compatible-revision-range="::e2f8ed37201c^+c52435820bbd::"
+
+[simple-command.variants.dimensions.threads.1]
+environment.THREADS = "1"
+# A bug in the code forced the thread count to 16
+constraints.compatible-revision-range="::e2f8ed37201c^+c52435820bbd::"
+
+[simple-command.variants.dimensions.threads.8]
+environment.THREADS = "8"
+# A bug in the code forced the thread count to 16
+constraints.compatible-revision-range="::e2f8ed37201c^+c52435820bbd::"
+
+[simple-command.variants.dimensions.threads.16]
+environment.THREADS = "16"
+
+[simple-command.variants.dimensions.threads.32]
+environment.THREADS = "32"
+# A bug in the code forced the thread count to 16
+constraints.compatible-revision-range="::e2f8ed37201c^+c52435820bbd::"
+
+[simple-command.variants.dimensions.threads.64]
+environment.THREADS = "64"
+# A bug in the code forced the thread count to 16
+constraints.compatible-revision-range="::e2f8ed37201c^+c52435820bbd::"