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
STEVAN Antoine
Komodo
Commits
8bb64f99
Verified
Commit
8bb64f99
authored
1 year ago
by
STEVAN Antoine
Browse files
Options
Downloads
Patches
Plain Diff
filter setup by curves
parent
5e41df1d
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
+20
-12
20 additions, 12 deletions
benches/plot.py
with
20 additions
and
12 deletions
benches/plot.py
+
20
−
12
View file @
8bb64f99
...
...
@@ -99,8 +99,14 @@ def plot_setup(data: Data, save: bool = False):
fig
,
axs
=
plt
.
subplots
(
4
,
1
,
sharex
=
True
,
figsize
=
(
16
,
9
))
# key: the start of the `$.id` field
def
plot
(
data
:
Data
,
key
:
str
,
label
:
str
,
color
:
str
,
error_bar
:
bool
,
ax
):
filtered_data
=
list
(
filter
(
lambda
line
:
line
[
"
id
"
].
startswith
(
key
),
data
))
def
plot
(
data
:
Data
,
key
:
str
,
curve
:
str
,
label
:
str
,
color
:
str
,
error_bar
:
bool
,
ax
):
filtered_data
=
list
(
filter
(
lambda
line
:
line
[
"
id
"
].
startswith
(
key
)
and
line
[
"
id
"
].
endswith
(
f
"
on
{
curve
}
"
),
data
))
if
len
(
filtered_data
)
==
0
:
return
sizes
=
[
int
(
line
[
"
id
"
].
lstrip
(
key
).
split
(
'
'
)[
0
])
for
line
in
filtered_data
]
if
error_bar
:
...
...
@@ -115,34 +121,36 @@ def plot_setup(data: Data, save: bool = False):
if
error_bar
:
ax
.
fill_between
(
sizes
,
down
,
up
,
color
=
color
,
alpha
=
0.3
)
curve
=
"
BLS12-381
"
# setup
plot
(
data
,
"
setup/setup (komodo)
"
,
"
komodo
"
,
"
orange
"
,
True
,
axs
[
0
])
plot
(
data
,
"
setup (arkworks)
"
,
"
arkworks
"
,
"
blue
"
,
True
,
axs
[
0
])
plot
(
data
,
"
setup/setup (komodo)
"
,
curve
,
"
komodo
"
,
"
orange
"
,
True
,
axs
[
0
])
plot
(
data
,
"
setup (arkworks)
"
,
curve
,
"
arkworks
"
,
"
blue
"
,
True
,
axs
[
0
])
axs
[
0
].
set_title
(
"
time to generate a random trusted setup
"
)
axs
[
0
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
0
].
legend
()
axs
[
0
].
grid
()
# serialization
plot
(
data
,
"
setup/serializing with compression
"
,
"
compressed
"
,
"
orange
"
,
True
,
axs
[
1
])
plot
(
data
,
"
setup/serializing with no compression
"
,
"
uncompressed
"
,
"
blue
"
,
True
,
axs
[
1
])
plot
(
data
,
"
setup/serializing with compression
"
,
curve
,
"
compressed
"
,
"
orange
"
,
True
,
axs
[
1
])
plot
(
data
,
"
setup/serializing with no compression
"
,
curve
,
"
uncompressed
"
,
"
blue
"
,
True
,
axs
[
1
])
axs
[
1
].
set_title
(
"
serialization
"
)
axs
[
1
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
1
].
legend
()
axs
[
1
].
grid
()
# deserialization
plot
(
data
,
"
setup/deserializing with no compression and no validation
"
,
"
uncompressed unvalidated
"
,
"
red
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with compression and no validation
"
,
"
compressed unvalidated
"
,
"
orange
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with no compression and validation
"
,
"
uncompressed validated
"
,
"
blue
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with compression and validation
"
,
"
compressed validated
"
,
"
green
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with no compression and no validation
"
,
curve
,
"
uncompressed unvalidated
"
,
"
red
"
,
True
,
axs
[
2
])
plot
(
data
,
"
setup/deserializing with compression and no validation
"
,
curve
,
"
compressed unvalidated
"
,
"
orange
"
,
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 validation
"
,
curve
,
"
compressed validated
"
,
"
green
"
,
True
,
axs
[
2
])
axs
[
2
].
set_title
(
"
deserialization
"
)
axs
[
2
].
set_ylabel
(
"
time (in ms)
"
)
axs
[
2
].
legend
()
axs
[
2
].
grid
()
plot
(
data
,
"
serialized size with no compression
"
,
"
uncompressed
"
,
"
orange
"
,
False
,
axs
[
3
])
plot
(
data
,
"
serialized size with compression
"
,
"
compressed
"
,
"
blue
"
,
False
,
axs
[
3
])
plot
(
data
,
"
serialized size with no compression
"
,
curve
,
"
uncompressed
"
,
"
orange
"
,
False
,
axs
[
3
])
plot
(
data
,
"
serialized size with compression
"
,
curve
,
"
compressed
"
,
"
blue
"
,
False
,
axs
[
3
])
axs
[
3
].
set_title
(
"
size
"
)
axs
[
3
].
set_xlabel
(
"
degree
"
)
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