Skip to content
Snippets Groups Projects
Commit 98ec07b9 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

show pretty filesize in titles and improve func (!215)

continuation of
- !193
- !212
- !213
- !214
parent fd081eed
No related branches found
No related tags found
1 merge request!215show pretty filesize in titles and improve func
Pipeline #9338 passed
......@@ -246,8 +246,13 @@ def pretty-duration []: [ list<number> -> list<string> ] {
}
}
}
def pretty-filesize []: [ list<number> -> list<string> ] {
into filesize | each {
def pretty-filesize []: [
number -> string,
filesize -> string,
list<number> -> list<string>,
list<filesize> -> list<string>,
] {
def convert []: [ filesize -> string ] {
if $in < 1kib {
format filesize B
} else if $in < 1mib {
......@@ -262,6 +267,11 @@ def pretty-filesize []: [ list<number> -> list<string> ] {
format filesize PiB
}
}
$in | into filesize | match ($in | describe --detailed).type {
"list" => { each { convert } },
_ => { convert },
}
}
def plot [
......@@ -721,7 +731,7 @@ export def main [
] {
open (in "protocols") | (plot-bars
-o (out $"protocols-b($params.nb_bytes)-k($params.k)-n($params.n)")
-t $"time to run cryptographic \\textit{protocols} data of size $($params.nb_bytes)$, $k = ($params.k)$ on \\textbf{BN254} \(r: $(curve-to-field-modulus 'BN254' | get r)$ bits\), $\\rho = \\frac{1}{2}$"
-t $"time to run cryptographic \\textit{protocols} on data of size $($params.nb_bytes)$ \(($params.nb_bytes | pretty-filesize)\), $k = ($params.k)$ on \\textbf{BN254} \(r: $(curve-to-field-modulus 'BN254' | get r)$ bits\), $\\rho = \\frac{1}{2}$"
-l "time in %unit"
--log-scale
--grid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment