Skip to content
Snippets Groups Projects
Verified Commit 8bb64f99 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

filter setup by curves

parent 5e41df1d
No related branches found
No related tags found
No related merge requests found
......@@ -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)")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment