Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Komodo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
HEME Clement
Komodo
Commits
0163c8f9
Verified
Commit
0163c8f9
authored
1 year ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
plot all curves in setup
parent
8bb64f99
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benches/plot.py
+16
-14
16 additions, 14 deletions
benches/plot.py
with
16 additions
and
14 deletions
benches/plot.py
+
16
−
14
View file @
0163c8f9
...
@@ -99,7 +99,7 @@ def plot_setup(data: Data, save: bool = False):
...
@@ -99,7 +99,7 @@ def plot_setup(data: Data, save: bool = False):
fig
,
axs
=
plt
.
subplots
(
4
,
1
,
sharex
=
True
,
figsize
=
(
16
,
9
))
fig
,
axs
=
plt
.
subplots
(
4
,
1
,
sharex
=
True
,
figsize
=
(
16
,
9
))
# key: the start of the `$.id` field
# key: the start of the `$.id` field
def
plot
(
data
:
Data
,
key
:
str
,
curve
:
str
,
label
:
str
,
color
:
str
,
error_bar
:
bool
,
ax
):
def
plot
(
data
:
Data
,
key
:
str
,
curve
:
str
,
label
:
str
,
color
:
str
,
style
:
str
,
error_bar
:
bool
,
ax
):
filtered_data
=
list
(
filter
(
filtered_data
=
list
(
filter
(
lambda
line
:
line
[
"
id
"
].
startswith
(
key
)
and
line
[
"
id
"
].
endswith
(
f
"
on
{
curve
}
"
),
lambda
line
:
line
[
"
id
"
].
startswith
(
key
)
and
line
[
"
id
"
].
endswith
(
f
"
on
{
curve
}
"
),
data
data
...
@@ -116,41 +116,43 @@ def plot_setup(data: Data, save: bool = False):
...
@@ -116,41 +116,43 @@ def plot_setup(data: Data, save: bool = False):
else
:
else
:
means
=
b_to_kb
(
extract
(
filtered_data
,
"
mean
"
,
None
))
means
=
b_to_kb
(
extract
(
filtered_data
,
"
mean
"
,
None
))
ax
.
plot
(
sizes
,
means
,
label
=
label
,
color
=
color
)
ax
.
plot
(
sizes
,
means
,
label
=
f
"
{
label
}
on
{
curve
}
"
,
color
=
color
,
linestyle
=
style
)
if
error_bar
:
if
error_bar
:
ax
.
fill_between
(
sizes
,
down
,
up
,
color
=
color
,
alpha
=
0.3
)
ax
.
fill_between
(
sizes
,
down
,
up
,
color
=
color
,
alpha
=
0.3
)
curve
=
"
BLS12-381
"
# setup
# setup
plot
(
data
,
"
setup/setup (komodo)
"
,
curve
,
"
komodo
"
,
"
orange
"
,
True
,
axs
[
0
])
for
(
curve
,
color
)
in
[(
"
BLS12-381
"
,
"
blue
"
),
(
"
BN-254
"
,
"
orange
"
),
(
"
PALLAS
"
,
"
green
"
)]:
plot
(
data
,
"
setup (arkworks)
"
,
curve
,
"
arkworks
"
,
"
blue
"
,
True
,
axs
[
0
])
plot
(
data
,
"
setup/setup (komodo)
"
,
curve
,
"
komodo
"
,
color
,
"
solid
"
,
True
,
axs
[
0
])
plot
(
data
,
"
setup (arkworks)
"
,
curve
,
"
arkworks
"
,
color
,
"
dashed
"
,
True
,
axs
[
0
])
axs
[
0
].
set_title
(
"
time to generate a random trusted setup
"
)
axs
[
0
].
set_title
(
"
time to generate a random trusted setup
"
)
axs
[
0
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
0
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
0
].
legend
()
axs
[
0
].
legend
()
axs
[
0
].
grid
()
axs
[
0
].
grid
()
# serialization
# serialization
plot
(
data
,
"
setup/serializing with compression
"
,
curve
,
"
compressed
"
,
"
orange
"
,
True
,
axs
[
1
])
for
(
curve
,
color
)
in
[(
"
BLS12-381
"
,
"
blue
"
),
(
"
BN-254
"
,
"
orange
"
),
(
"
PALLAS
"
,
"
green
"
)]:
plot
(
data
,
"
setup/serializing with no compression
"
,
curve
,
"
uncompressed
"
,
"
blue
"
,
True
,
axs
[
1
])
plot
(
data
,
"
setup/serializing with compression
"
,
curve
,
"
compressed
"
,
color
,
"
solid
"
,
True
,
axs
[
1
])
plot
(
data
,
"
setup/serializing with no compression
"
,
curve
,
"
uncompressed
"
,
color
,
"
dashed
"
,
True
,
axs
[
1
])
axs
[
1
].
set_title
(
"
serialization
"
)
axs
[
1
].
set_title
(
"
serialization
"
)
axs
[
1
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
1
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
1
].
legend
()
axs
[
1
].
legend
()
axs
[
1
].
grid
()
axs
[
1
].
grid
()
# deserialization
# deserialization
plot
(
data
,
"
setup/deserializing with no compression and no validation
"
,
curve
,
"
uncompressed unvalidated
"
,
"
red
"
,
True
,
axs
[
2
])
for
(
curve
,
color
)
in
[(
"
BLS12-381
"
,
"
blue
"
),
(
"
BN-254
"
,
"
orange
"
),
(
"
PALLAS
"
,
"
green
"
)]:
plot
(
data
,
"
setup/deserializing with compression and no validation
"
,
curve
,
"
compressed unvalidated
"
,
"
orange
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with no compression and no validation
"
,
curve
,
"
uncompressed unvalidated
"
,
color
,
"
dotted
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with no compression and validation
"
,
curve
,
"
uncompressed validated
"
,
"
blue
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with compression and no validation
"
,
curve
,
"
compressed unvalidated
"
,
color
,
"
dashed
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with compression and validation
"
,
curve
,
"
compressed validated
"
,
"
green
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with no compression and validation
"
,
curve
,
"
uncompressed validated
"
,
color
,
"
dashdot
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with compression and validation
"
,
curve
,
"
compressed validated
"
,
color
,
"
solid
"
,
True
,
axs
[
2
])
axs
[
2
].
set_title
(
"
deserialization
"
)
axs
[
2
].
set_title
(
"
deserialization
"
)
axs
[
2
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
2
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
2
].
legend
()
axs
[
2
].
legend
()
axs
[
2
].
grid
()
axs
[
2
].
grid
()
plot
(
data
,
"
serialized size with no compression
"
,
curve
,
"
uncompressed
"
,
"
orange
"
,
False
,
axs
[
3
])
for
(
curve
,
color
)
in
[(
"
BLS12-381
"
,
"
blue
"
),
(
"
BN-254
"
,
"
orange
"
),
(
"
PALLAS
"
,
"
green
"
)]:
plot
(
data
,
"
serialized size with compression
"
,
curve
,
"
compressed
"
,
"
blue
"
,
False
,
axs
[
3
])
plot
(
data
,
"
serialized size with no compression
"
,
curve
,
"
uncompressed
"
,
color
,
"
dashed
"
,
False
,
axs
[
3
])
plot
(
data
,
"
serialized size with compression
"
,
curve
,
"
compressed
"
,
color
,
"
solid
"
,
False
,
axs
[
3
])
axs
[
3
].
set_title
(
"
size
"
)
axs
[
3
].
set_title
(
"
size
"
)
axs
[
3
].
set_xlabel
(
"
degree
"
)
axs
[
3
].
set_xlabel
(
"
degree
"
)
axs
[
3
].
set_ylabel
(
"
size (in kb)
"
)
axs
[
3
].
set_ylabel
(
"
size (in kb)
"
)
...
...
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