Skip to content

Commit c3fc5c6

Browse files
pks-tgitster
authored andcommitted
meson: wire up benchmarking options
Wire up a couple of benchmarking options that we end up writing into our "GIT-BUILD-OPTIONS" file. These options allow users to control how exactly benchmarks are executed. Note that neither `GIT_PERF_MAKE_COMMAND` nor `GIT_PERF_MAKE_OPTS` are exposed as a build option. Those options are used by "t/perf/run", which is not used by Meson. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d84eefa commit c3fc5c6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,11 @@ builtin_sources += custom_target(
706706
# build options to our tests.
707707
build_options_config = configuration_data()
708708
build_options_config.set('GIT_INTEROP_MAKE_OPTS', '')
709-
build_options_config.set('GIT_PERF_LARGE_REPO', '')
709+
build_options_config.set_quoted('GIT_PERF_LARGE_REPO', get_option('benchmark_large_repo'))
710710
build_options_config.set('GIT_PERF_MAKE_COMMAND', '')
711711
build_options_config.set('GIT_PERF_MAKE_OPTS', '')
712-
build_options_config.set('GIT_PERF_REPEAT_COUNT', '')
713-
build_options_config.set('GIT_PERF_REPO', '')
712+
build_options_config.set_quoted('GIT_PERF_REPEAT_COUNT', get_option('benchmark_repeat_count').to_string())
713+
build_options_config.set_quoted('GIT_PERF_REPO', get_option('benchmark_repo'))
714714
build_options_config.set('GIT_TEST_CMP_USE_COPIED_CONTEXT', '')
715715
build_options_config.set('GIT_TEST_INDEX_VERSION', '')
716716
build_options_config.set('GIT_TEST_OPTS', '')

meson_options.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ option('docs_backend', type: 'combo', choices: ['asciidoc', 'asciidoctor', 'auto
103103
# Testing.
104104
option('benchmarks', type: 'feature', value: 'auto',
105105
description: 'Enable benchmarks. This requires Perl and GNU time.')
106+
option('benchmark_repo', type: 'string', value: '',
107+
description: 'Repository to copy for the performance tests. Should be at least the size of the Git repository.')
108+
option('benchmark_large_repo', type: 'string', value: '',
109+
description: 'Large repository to copy for the performance tests. Should be at least the size of the Linux repository.')
110+
option('benchmark_repeat_count', type: 'integer', value: 3,
111+
description: 'Number of times a test should be repeated for best-of-N measurements.')
106112
option('coccinelle', type: 'feature', value: 'auto',
107113
description: 'Provide a coccicheck target that generates a Coccinelle patch.')
108114
option('tests', type: 'boolean', value: true,

0 commit comments

Comments
 (0)