Skip to content
Snippets Groups Projects
Commit 3674705944b6 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

benchmark: add a benchmark for `hg cat`

There is pathological performance around pattern matching that can cripple the
command.
parent 5f01c23e26e6
No related branches found
No related tags found
No related merge requests found
[meta]
format="0"
name="cat"
method="simple-command"
[run]
copy-data-env = true
[simple-command]
command='hg cat $REV "$FILES" $TEMPLATE > /dev/null'
cwd="DATA-VARS:mercurial.main-repo-path"
prepare-run = """
# XXX We could only do this once before the benchmark instead of doing this for
# each run, especially the one who do not need them.
hg files $REV --template 'path:{path}\n' | sort > ../all_sorted.path;
shuf ../all_sorted.path --random-source=../all_sorted.path > ../all_suffled.path;
hg files $REV | sed 's/\\({\\|}\\|\\[\\|\\]\\|*\\|?\\)/\\\\\\1/g' | sort > ../all_sorted.pattern;
shuf ../all_sorted.pattern --random-source=../all_sorted.pattern > ../all_suffled.pattern;
"""
[simple-command.variants.dimensions.rev.tip]
default=true
environment.REV="--rev tip"
[simple-command.variants.dimensions.output.plain]
default=true
environment.TEMPLATE=""
[simple-command.variants.dimensions.output.json]
environment.TEMPLATE="--template json"
[simple-command.variants.dimensions.files.all-root]
default=true
environment.FILES="."
[simple-command.variants.dimensions.files.all-glob]
environment.FILES="set:**"
[simple-command.variants.dimensions.files.all-list-path-sorted]
environment.FILES='set:listfile:../all_sorted.path'
[simple-command.variants.dimensions.files.all-list-path-shuffled]
environment.FILES='set:listfile:../all_suffled.path'
[simple-command.variants.dimensions.files.all-list-pattern-sorted]
environment.FILES='set:listfile:../all_sorted.pattern'
[simple-command.variants.dimensions.files.all-list-pattern-shuffled]
environment.FILES='set:listfile:../all_suffled.pattern'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment