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
Service Desk
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
Show more breadcrumbs
mercurial
scmperf
Commits
4a17b057f4f4
Commit
4a17b057f4f4
authored
7 years ago
by
Boris Feld
Browse files
Options
Downloads
Patches
Plain Diff
Add netlify configuration
parent
2858bf0368b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/basic_commands.py
+50
-5
50 additions, 5 deletions
benchmarks/basic_commands.py
with
50 additions
and
5 deletions
benchmarks/basic_commands.py
+
50
−
5
View file @
4a17b057
...
...
@@ -17,7 +17,7 @@
class
TestSuite
(
object
):
params
=
(
REPOS
)
params
=
[
REPOS
]
param_names
=
[
"
repo
"
]
def
setup
(
self
,
repo_name
):
...
...
@@ -34,7 +34,7 @@
timings
=
[]
# Do a first measurement
first_measure
=
self
.
_single_execute
(
cmd
)
\
first_measure
=
self
.
_single_execute
(
cmd
)
N
=
int
(
30
/
first_measure
)
...
...
@@ -93,7 +93,7 @@
class
TimeTestSuite
(
object
):
params
=
(
REPOS
)
params
=
[
REPOS
]
param_names
=
[
"
repo
"
]
def
__init__
(
self
):
...
...
@@ -137,6 +137,9 @@
time
=
self
.
_execute
(
"
status
"
,
"
--change
"
,
"
tip
"
)
return
time
def
bench_command_status
(
self
,
*
args
,
**
kwargs
):
return
"
status --change tip
"
def
time_emptydiff
(
self
,
*
args
,
**
kwargs
):
time
=
self
.
_execute
(
"
diff
"
)
return
time
...
...
@@ -146,8 +149,7 @@
return
time
def
time_log_tip
(
self
,
*
args
,
**
kwargs
):
time
=
self
.
_execute
(
"
log
"
,
"
-r
"
,
"
tip
"
)
return
time
self
.
_execute
(
"
log
"
,
"
-r
"
,
"
tip
"
)
def
time_summary
(
self
,
*
args
,
**
kwargs
):
time
=
self
.
_execute
(
"
summary
"
)
...
...
@@ -168,3 +170,46 @@
def
time_id_current
(
self
,
*
args
,
**
kwargs
):
time
=
self
.
_execute
(
"
id
"
,
"
-r
"
,
"
.
"
)
return
time
class
LogTimeTestSuite
(
object
):
params
=
[
REPOS
,
[
10
,
100
,
1000
,
10000
]]
param_names
=
[
"
repo
"
,
"
changesets
"
]
def
__init__
(
self
):
super
(
LogTimeTestSuite
,
self
).
__init__
()
self
.
timer
=
timeit
.
default_timer
self
.
goal_time
=
10
def
setup
(
self
,
repo_name
,
n
):
venv
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
executable
),
"
..
"
))
self
.
repo_name
=
repo_name
self
.
hgpath
=
os
.
path
.
join
(
venv
,
"
bin
"
,
"
hg
"
)
self
.
repo_path
=
os
.
path
.
join
(
REPOS_DIR
,
self
.
repo_name
)
def
_execute
(
self
,
command
,
*
args
):
cmd
=
self
.
_prepare_cmd
(
command
,
*
args
)
try
:
return
self
.
_single_execute
(
cmd
)
except
subprocess
.
CalledProcessError
as
error
:
print
(
"
ERROR OUTPUT
"
,
error
.
output
)
raise
def
_prepare_cmd
(
self
,
command
,
*
args
):
cmd
=
[
self
.
hgpath
,
"
--cwd
"
,
self
.
repo_path
,
"
--traceback
"
,
command
,
]
+
list
(
args
)
return
cmd
def
_single_execute
(
self
,
cmd
):
return
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
def
time_log_history
(
self
,
repo
,
n
):
self
.
_execute
(
"
log
"
,
"
-r
"
,
"
tip~%d::
"
%
n
)
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