Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
ghc-utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ben Gamari
ghc-utils
Commits
68497d00
Commit
68497d00
authored
Jan 11, 2021
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ghc_timings: Simple plotting
parent
7ae9ceaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
ghc_timings.py
ghc_timings.py
+8
-2
No files found.
ghc_timings.py
View file @
68497d00
...
...
@@ -5,6 +5,7 @@ import re
import
sys
import
typing
import
pandas
as
pd
from
matplotlib
import
pyplot
as
pl
from
typing
import
Iterator
class
Timing
(
typing
.
NamedTuple
):
...
...
@@ -26,11 +27,16 @@ def parse_timings(s: str) -> pd.DataFrame:
df
=
pd
.
DataFrame
(
xs
,
columns
=
[
'phase'
,
'module'
,
'time'
,
'allocd'
])
df
[
'n'
]
=
df
.
index
df
.
sort_values
(
by
=
[
'module'
,
'n'
],
inplace
=
True
)
return
df
.
drop
(
columns
=
'n'
)
return
df
# df
.drop(columns='n')
def
main
()
->
None
:
s
=
sys
.
stdin
.
read
()
print
(
parse_timings
(
s
).
to_markdown
())
df
=
parse_timings
(
s
)
print
(
df
.
to_markdown
())
df2
=
df
.
set_index
([
'module'
,
'phase'
,
'n'
])[
'time'
].
unstack
(
'module'
)
df2
.
plot
.
bar
(
title
=
'compile time (ms)'
,
rot
=
30
)
pl
.
show
()
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment