Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
scmperf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
This instance will be upgraded to Heptapod 17.11.0rc1 on 2025-04-24 between 17:00 and 18:00 UTC+2
Show more breadcrumbs
mercurial
scmperf
Commits
707a1242
Commit
707a1242
authored
6 years ago
by
Philippe Pepiot
Browse files
Options
Downloads
Patches
Plain Diff
Drop now unused perfbench() and bench() functions.
parent
baec9670
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/utils.py
+0
-49
0 additions, 49 deletions
benchmarks/utils.py
with
0 additions
and
49 deletions
benchmarks/utils.py
+
0
−
49
View file @
707a1242
...
...
@@ -96,12 +96,6 @@
return
decorator
def
bench
(
**
kwargs
):
def
repo_setup
(
repo_name
):
return
hg
.
repository
(
ui
.
ui
(),
os
.
path
.
join
(
REPOS_DIR
,
repo_name
))
return
_bench_with_repo
(
repo_setup
,
**
kwargs
)
PERF_RE
=
re
.
compile
(
r
'
! wall (\d+.\d+) comb (\d+.\d+) user (\d+.\d+) sys (\d+.\d+) \(best of (\d+)\)
'
)
...
...
@@ -105,49 +99,6 @@
PERF_RE
=
re
.
compile
(
r
'
! wall (\d+.\d+) comb (\d+.\d+) user (\d+.\d+) sys (\d+.\d+) \(best of (\d+)\)
'
)
def
perfbench
(
**
kwargs
):
def
repo_setup
(
repo_name
):
def
perf
(
command
,
*
args
):
venv
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
executable
),
"
..
"
))
if
os
.
path
.
isdir
(
os
.
path
.
join
(
venv
,
"
project
"
)):
# Used with asv run (installed in virtualenv)
perfpath
=
os
.
path
.
join
(
venv
,
"
project
"
,
"
contrib
"
,
"
perf.py
"
)
hgpath
=
os
.
path
.
join
(
venv
,
"
bin
"
,
"
hg
"
)
else
:
# Used with asv dev (installed in ./mercurial)
perfpath
=
os
.
path
.
join
(
BASEDIR
,
"
mercurial
"
,
"
contrib
"
,
"
perf.py
"
)
hgpath
=
os
.
path
.
join
(
BASEDIR
,
"
mercurial
"
,
"
hg
"
)
basecmd
=
[
hgpath
,
"
--config
"
,
"
extensions.perf=
"
+
perfpath
,
]
os
.
environ
[
"
HGRCPATH
"
]
=
""
# test if the command exist in this perf.py version using 'hg help'
cmd
=
basecmd
+
[
"
-R
"
,
os
.
path
.
join
(
REPOS_DIR
,
repo_name
),
command
]
+
list
(
args
)
try
:
output
=
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
exc
:
if
exc
.
returncode
==
255
:
# test if it return 255 because the command does not exist
# or if it's another issue
try
:
output
=
subprocess
.
check_output
(
basecmd
+
[
'
help
'
,
command
])
except
subprocess
.
CalledProcessError
as
exc
:
if
exc
.
returncode
==
255
:
# command does not exist for this version of perf.py NaN
# result to n/a displayed in results which is a kind of
# "skipped" status
return
float
(
'
nan
'
)
raise
raise
match
=
PERF_RE
.
search
(
output
)
if
not
match
:
raise
ValueError
(
"
Invalid output {0}
"
.
format
(
output
))
return
float
(
match
.
group
(
1
))
return
perf
return
_bench_with_repo
(
repo_setup
,
**
kwargs
)
###
# Base classes for benchmarks
###
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment