Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
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
FINAM
finam
Commits
cd96ea17
Commit
cd96ea17
authored
2 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
convert profiling output to CSV
parent
ede3c38e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!221
Benchmark full run, profiling
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/pstats_to_csv.py
+26
-0
26 additions, 0 deletions
benchmarks/pstats_to_csv.py
benchmarks/run_profiling.sh
+4
-1
4 additions, 1 deletion
benchmarks/run_profiling.sh
with
30 additions
and
1 deletion
benchmarks/pstats_to_csv.py
0 → 100644
+
26
−
0
View file @
cd96ea17
import
io
import
os
import
pstats
def
_convert_to_csv
(
in_path
,
out_path
):
result
=
io
.
StringIO
()
pstats
.
Stats
(
in_path
,
stream
=
result
).
print_stats
()
result
=
result
.
getvalue
()
result
=
"
ncalls
"
+
result
.
split
(
"
ncalls
"
)[
-
1
]
result
=
"
\n
"
.
join
(
[
"
,
"
.
join
(
line
.
rstrip
().
split
(
None
,
5
))
for
line
in
result
.
split
(
"
\n
"
)]
)
with
open
(
out_path
,
"
w+
"
)
as
f
:
f
.
write
(
result
)
f
.
close
()
if
__name__
==
"
__main__
"
:
path
=
"
prof/
"
for
file
in
os
.
listdir
(
path
):
if
file
.
endswith
(
"
.pstats
"
):
in_file
=
os
.
path
.
join
(
path
,
file
)
out_file
=
os
.
path
.
join
(
path
,
file
.
replace
(
"
.pstats
"
,
"
.csv
"
))
_convert_to_csv
(
in_file
,
out_file
)
This diff is collapsed.
Click to expand it.
benchmarks/run_profiling.sh
+
4
−
1
View file @
cd96ea17
echo
TEST
echo
Profiling...
mkdir
-p
prof
python
-m
cProfile
-o
prof/simple_run.pstats benchmarks/profiling/simple_run.py
gprof2dot
--colour-nodes-by-selftime
-f
pstats prof/simple_run.pstats
>
prof/simple_run.dot
dot
-Tsvg
-o
prof/simple_run.svg prof/simple_run.dot
dot
-Tpng
-o
prof/simple_run.png prof/simple_run.dot
python benchmarks/pstats_to_csv.py
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