Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
48dbdfd9
Commit
48dbdfd9
authored
8 years ago
by
Craig Tiller
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9724 from ctiller/parallel-perf
Run perf benchmarks in parallel
parents
86e9f356
6ad0072f
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
tools/run_tests/run_microbenchmark.py
+36
-15
36 additions, 15 deletions
tools/run_tests/run_microbenchmark.py
with
36 additions
and
15 deletions
tools/run_tests/run_microbenchmark.py
+
36
−
15
View file @
48dbdfd9
...
@@ -126,24 +126,45 @@ def collect_perf(bm_name, args):
...
@@ -126,24 +126,45 @@ def collect_perf(bm_name, args):
subprocess
.
check_call
(
subprocess
.
check_call
(
[
'
make
'
,
bm_name
,
[
'
make
'
,
bm_name
,
'
CONFIG=mutrace
'
,
'
-j
'
,
'
%d
'
%
multiprocessing
.
cpu_count
()])
'
CONFIG=mutrace
'
,
'
-j
'
,
'
%d
'
%
multiprocessing
.
cpu_count
()])
benchmarks
=
[]
profile_analysis
=
[]
cleanup
=
[]
for
line
in
subprocess
.
check_output
([
'
bins/mutrace/%s
'
%
bm_name
,
for
line
in
subprocess
.
check_output
([
'
bins/mutrace/%s
'
%
bm_name
,
'
--benchmark_list_tests
'
]).
splitlines
():
'
--benchmark_list_tests
'
]).
splitlines
():
link
(
line
,
'
%s.svg
'
%
fnize
(
line
))
link
(
line
,
'
%s.svg
'
%
fnize
(
line
))
subprocess
.
check_call
([
'
perf
'
,
'
record
'
,
'
-o
'
,
'
%s-perf.data
'
%
fnize
(
line
),
benchmarks
.
append
(
'
-g
'
,
'
-c
'
,
'
1000
'
,
jobset
.
JobSpec
([
'
perf
'
,
'
record
'
,
'
-o
'
,
'
%s-perf.data
'
%
fnize
(
line
),
'
bins/mutrace/%s
'
%
bm_name
,
'
-g
'
,
'
-c
'
,
'
1000
'
,
'
--benchmark_filter=^%s$
'
%
line
,
'
bins/mutrace/%s
'
%
bm_name
,
'
--benchmark_min_time=10
'
])
'
--benchmark_filter=^%s$
'
%
line
,
env
=
os
.
environ
.
copy
()
'
--benchmark_min_time=10
'
]))
env
.
update
({
profile_analysis
.
append
(
'
PERF_BASE_NAME
'
:
fnize
(
line
),
jobset
.
JobSpec
([
'
tools/run_tests/performance/process_local_perf_flamegraphs.sh
'
],
'
OUTPUT_DIR
'
:
'
reports
'
,
environ
=
{
'
OUTPUT_FILENAME
'
:
fnize
(
line
),
'
PERF_BASE_NAME
'
:
fnize
(
line
),
})
'
OUTPUT_DIR
'
:
'
reports
'
,
subprocess
.
check_call
([
'
tools/run_tests/performance/process_local_perf_flamegraphs.sh
'
],
'
OUTPUT_FILENAME
'
:
fnize
(
line
),
env
=
env
)
}))
subprocess
.
check_call
([
'
rm
'
,
'
%s-perf.data
'
%
fnize
(
line
)])
cleanup
.
append
(
jobset
.
JobSpec
([
'
rm
'
,
'
%s-perf.data
'
%
fnize
(
line
)]))
subprocess
.
check_call
([
'
rm
'
,
'
%s-out.perf
'
%
fnize
(
line
)])
cleanup
.
append
(
jobset
.
JobSpec
([
'
rm
'
,
'
%s-out.perf
'
%
fnize
(
line
)]))
# periodically flush out the list of jobs: temporary space required for this
# processing is large
if
len
(
benchmarks
)
>=
20
:
# run up to half the cpu count: each benchmark can use up to two cores
# (one for the microbenchmark, one for the data flush)
jobset
.
run
(
benchmarks
,
maxjobs
=
max
(
1
,
multiprocessing
.
cpu_count
()
/
2
),
add_env
=
{
'
GRPC_TEST_PORT_SERVER
'
:
'
localhost:%d
'
%
port_server_port
})
jobset
.
run
(
profile_analysis
,
maxjobs
=
multiprocessing
.
cpu_count
())
jobset
.
run
(
cleanup
,
maxjobs
=
multiprocessing
.
cpu_count
())
benchmarks
=
[]
profile_analysis
=
[]
cleanup
=
[]
# run the remaining benchmarks that weren't flushed
if
len
(
benchmarks
):
jobset
.
run
(
benchmarks
,
maxjobs
=
max
(
1
,
multiprocessing
.
cpu_count
()
/
2
),
add_env
=
{
'
GRPC_TEST_PORT_SERVER
'
:
'
localhost:%d
'
%
port_server_port
})
jobset
.
run
(
profile_analysis
,
maxjobs
=
multiprocessing
.
cpu_count
())
jobset
.
run
(
cleanup
,
maxjobs
=
multiprocessing
.
cpu_count
())
def
collect_summary
(
bm_name
,
args
):
def
collect_summary
(
bm_name
,
args
):
heading
(
'
Summary: %s
'
%
bm_name
)
heading
(
'
Summary: %s
'
%
bm_name
)
...
...
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