Skip to content
Snippets Groups Projects
Commit d7e84161 authored by STEVAN Antoine's avatar STEVAN Antoine 🦀
Browse files

dont' hardcode curves in the benchmarks (dragoon/komodo!99)

up until now, elliptic curves have been hardcoded in the benchmarks, forcing to run them on all supported curves...

this MR makes it possible to use only a subset of curves.

> 💡 **Note**  
> when running the same commands from !104, minus the "inbreeding" ones which are not affected by this MR, the time goes from 12min 33sec to 4min 28sec 🎉 


## TODO
- [x] setup
- [x] commit
- [x] recoding
- [x] fec
- [ ] linalg
- [ ] setup size
- [ ] field operations
- [ ] group operations

> 💡 **Note**  
> because all the unticked bullet points above are far from critical to the paper and do require to measure all curves, i won't change these for now
parent 0f43be24
No related branches found
No related tags found
1 merge request!99dont' hardcode curves in the benchmarks
Pipeline #5190 passed
Showing
with 296 additions and 137 deletions
......@@ -77,7 +77,7 @@ for graph in [
## trusted setup
```nushell
use scripts/setup/run.nu; seq 0 13 | each { 2 ** $in } | run --output setup.ndjson
use scripts/setup/run.nu; seq 0 13 | each { 2 ** $in } | run --output setup.ndjson --curves [ bls12381, pallas, bn254 ]
```
```nushell
use ./scripts/setup/plot.nu; plot setup.ndjson
......@@ -85,7 +85,7 @@ use ./scripts/setup/plot.nu; plot setup.ndjson
## commit
```nushell
use scripts/commit/run.nu; seq 0 13 | each { 2 ** $in } | run --output commit.ndjson
use scripts/commit/run.nu; seq 0 13 | each { 2 ** $in } | run --output commit.ndjson --curves [bls12381, pallas, bn254 ]
```
```nushell
use ./scripts/commit/plot.nu; plot commit.ndjson
......@@ -95,7 +95,7 @@ use ./scripts/commit/plot.nu; plot commit.ndjson
### recoding
```nushell
use scripts/recoding/run.nu
seq 0 18 | each { 512 * 2 ** $in } | run --ks [2, 4, 8, 16] --output recoding.ndjson
seq 0 18 | each { 512 * 2 ** $in } | run --ks [2, 4, 8, 16] --output recoding.ndjson --curves [ bls12381 ]
```
```nushell
use ./scripts/recoding/plot.nu; plot recoding.ndjson
......@@ -104,7 +104,7 @@ use ./scripts/recoding/plot.nu; plot recoding.ndjson
### FEC
```nushell
use scripts/fec/run.nu
seq 0 18 | each { 512 * 2 ** $in } | run --ks [2, 4, 8, 16] --output fec.ndjson
seq 0 18 | each { 512 * 2 ** $in } | run --ks [2, 4, 8, 16] --output fec.ndjson --curves [ bls12381 ]
```
```nushell
use ./scripts/fec/plot.nu; plot encoding fec.ndjson
......
......@@ -5,7 +5,7 @@ use ark_poly::{univariate::DensePolynomial, DenseUVPolynomial};
use ark_poly_commit::kzg10::{self, KZG10};
use ark_std::ops::Div;
use clap::{arg, command, Parser};
use clap::{arg, command, Parser, ValueEnum};
use komodo::zk;
fn run<F, G, P>(degrees: &Vec<usize>, curve: &str, nb_measurements: usize)
......@@ -86,27 +86,37 @@ where
/// G1 = G1Projective,
/// E = Bls12_381,
/// name = "BLS12-381"
/// );
/// )
/// ```
/// will produce
/// ```rust
/// run::<ark_bls12_381::Fr, ark_bls12_381::G1Projective, DensePolynomial<ark_bls12_381::Fr> >(&degrees, "BLS12-381", 10);
/// ark_run::<ark_bls12_381::Bls12_381, DensePolynomial<<ark_bls12_381::Bls12_381 as Pairing>::ScalarField>>(&degrees, "BLS12-381", 10);
/// ark_run::<ark_bls12_381::Bls12_381, DensePolynomial<<ark_bls12_381::Bls12_381 as Pairing>::ScalarField>>(&degrees, "BLS12-381", 10)
/// ```
macro_rules! measure {
($c:ident, $d:ident, $m:expr, G1=$g:ident, name=$n:expr) => {
run::<$c::Fr, $c::$g, DensePolynomial<$c::Fr>>(&$d, $n, $m);
run::<$c::Fr, $c::$g, DensePolynomial<$c::Fr>>(&$d, $n, $m)
};
($c:ident, $d:ident, $m:expr, G1=$g:ident, E=$e:ident, name=$n:expr) => {
measure!($c, $d, $m, G1 = $g, name = $n);
ark_run::<$c::$e, DensePolynomial<<$c::$e as Pairing>::ScalarField>>(
&$d,
concat!($n, "-ark"),
$m,
);
)
};
}
#[derive(ValueEnum, Clone, Hash, PartialEq, Eq)]
enum Curve {
BLS12381,
BN254,
Pallas,
ARKBLS12381,
ARKBN254,
SECP256K1,
SECP256R1,
Vesta,
}
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
......@@ -118,54 +128,91 @@ struct Cli {
/// the measurements
#[arg(short, long)]
nb_measurements: usize,
#[arg(short, long, num_args=1.., value_delimiter = ',')]
curves: Vec<Curve>,
}
fn main() {
let cli = Cli::parse();
let degrees = cli.degrees;
measure!(
ark_pallas,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "PALLAS"
);
measure!(
ark_bls12_381,
degrees,
cli.nb_measurements,
G1 = G1Projective,
E = Bls12_381,
name = "BLS12-381"
);
measure!(
ark_bn254,
degrees,
cli.nb_measurements,
G1 = G1Projective,
E = Bn254,
name = "BN-254"
);
measure!(
ark_secp256k1,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "SECP256-K1"
);
measure!(
ark_secp256r1,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "SECP256-R1"
);
measure!(
ark_vesta,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "VESTA"
);
for curve in cli.curves {
match curve {
Curve::Pallas => {
measure!(
ark_pallas,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "PALLAS"
)
}
Curve::ARKBLS12381 => {
measure!(
ark_bls12_381,
degrees,
cli.nb_measurements,
G1 = G1Projective,
E = Bls12_381,
name = "BLS12-381"
)
}
Curve::ARKBN254 => {
measure!(
ark_bn254,
degrees,
cli.nb_measurements,
G1 = G1Projective,
E = Bn254,
name = "BN254"
)
}
Curve::BLS12381 => {
measure!(
ark_bls12_381,
degrees,
cli.nb_measurements,
G1 = G1Projective,
name = "BLS12-381"
)
}
Curve::BN254 => {
measure!(
ark_bn254,
degrees,
cli.nb_measurements,
G1 = G1Projective,
name = "BN254"
)
}
Curve::SECP256K1 => {
measure!(
ark_secp256k1,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "SECP256-K1"
)
}
Curve::SECP256R1 => {
measure!(
ark_secp256r1,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "SECP256-R1"
)
}
Curve::Vesta => {
measure!(
ark_vesta,
degrees,
cli.nb_measurements,
G1 = Projective,
name = "VESTA"
)
}
}
}
}
......@@ -68,6 +68,13 @@ enum Encoding {
Random,
}
#[derive(ValueEnum, Clone, Hash, PartialEq, Eq)]
enum Curve {
BLS12381,
BN254,
Pallas,
}
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
......@@ -78,6 +85,9 @@ struct Cli {
#[arg(short, long)]
encoding: Encoding,
#[arg(short, long, num_args=1.., value_delimiter = ' ')]
curves: Vec<Curve>,
#[arg(short)]
k: usize,
#[arg(short)]
......@@ -95,8 +105,26 @@ fn main() {
let b = plnk::Bencher::new(cli.nb_measurements);
for n in cli.sizes {
template::<ark_bls12_381::Fr>(&b.with_name("BLS12-381"), n, cli.k, cli.n, &cli.encoding);
template::<ark_bn254::Fr>(&b.with_name("BN-254"), n, cli.k, cli.n, &cli.encoding);
template::<ark_pallas::Fr>(&b.with_name("PALLAS"), n, cli.k, cli.n, &cli.encoding);
for curve in &cli.curves {
match curve {
Curve::BLS12381 => template::<ark_bls12_381::Fr>(
&b.with_name("BLS12-381"),
n,
cli.k,
cli.n,
&cli.encoding,
),
Curve::BN254 => {
template::<ark_bn254::Fr>(&b.with_name("BN254"), n, cli.k, cli.n, &cli.encoding)
}
Curve::Pallas => template::<ark_pallas::Fr>(
&b.with_name("PALLAS"),
n,
cli.k,
cli.n,
&cli.encoding,
),
}
}
}
}
......@@ -53,15 +53,15 @@ fn main() {
for n in cli.sizes {
inverse_template::<ark_bls12_381::Fr>(&b.with_name("BLS12-381"), n);
inverse_template::<ark_bn254::Fr>(&b.with_name("BN-254"), n);
inverse_template::<ark_bn254::Fr>(&b.with_name("BN254"), n);
inverse_template::<ark_pallas::Fr>(&b.with_name("PALLAS"), n);
transpose_template::<ark_bls12_381::Fr>(&b.with_name("BLS12-381"), n);
transpose_template::<ark_bn254::Fr>(&b.with_name("BN-254"), n);
transpose_template::<ark_bn254::Fr>(&b.with_name("BN254"), n);
transpose_template::<ark_pallas::Fr>(&b.with_name("PALLAS"), n);
mul_template::<ark_bls12_381::Fr>(&b.with_name("BLS12-381"), n);
mul_template::<ark_bn254::Fr>(&b.with_name("BN-254"), n);
mul_template::<ark_bn254::Fr>(&b.with_name("BN254"), n);
mul_template::<ark_pallas::Fr>(&b.with_name("PALLAS"), n);
}
}
......@@ -79,6 +79,6 @@ fn main() {
bench_template::<ark_bls12_381::Fr, ark_bls12_381::G1Projective>(
&bencher.with_name("BLS12-381"),
);
bench_template::<ark_bn254::Fr, ark_bn254::G1Projective>(&bencher.with_name("BN-254"));
bench_template::<ark_bn254::Fr, ark_bn254::G1Projective>(&bencher.with_name("BN254"));
bench_template::<ark_pallas::Fr, ark_pallas::Projective>(&bencher.with_name("PALLAS"));
}
......@@ -91,6 +91,6 @@ fn main() {
let bencher = plnk::Bencher::new(cli.nb_measurements);
bench_template::<ark_bls12_381::Fr>(&bencher.with_name("BLS12-381"));
bench_template::<ark_bn254::Fr>(&bencher.with_name("BN-254"));
bench_template::<ark_bn254::Fr>(&bencher.with_name("BN254"));
bench_template::<ark_pallas::Fr>(&bencher.with_name("PALLAS"));
}
......@@ -2,7 +2,7 @@
use ark_ff::PrimeField;
use ark_std::rand::Rng;
use clap::{arg, command, Parser};
use clap::{arg, command, Parser, ValueEnum};
use komodo::{
fec::{recode_with_coeffs, Shard},
field,
......@@ -48,6 +48,13 @@ fn bench_template<F: PrimeField>(b: &Bencher, nb_bytes: usize, k: usize, nb_shar
);
}
#[derive(ValueEnum, Clone, Hash, PartialEq, Eq)]
enum Curve {
BLS12381,
BN254,
Pallas,
}
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
......@@ -60,6 +67,9 @@ struct Cli {
#[arg(short, long, num_args = 1.., value_delimiter = ' ')]
ks: Vec<usize>,
#[arg(short, long, num_args=1.., value_delimiter = ' ')]
curves: Vec<Curve>,
/// the number of measurements to repeat each case, larger values will reduce the variance of
/// the measurements
#[arg(short, long)]
......@@ -74,9 +84,25 @@ fn main() {
for b in cli.bytes {
for s in &cli.shards {
for k in &cli.ks {
bench_template::<ark_bls12_381::Fr>(&bencher.with_name("BLS12-381"), b, *k, *s);
bench_template::<ark_bn254::Fr>(&bencher.with_name("BN-254"), b, *k, *s);
bench_template::<ark_pallas::Fr>(&bencher.with_name("PALLAS"), b, *k, *s);
for curve in &cli.curves {
match curve {
Curve::BLS12381 => bench_template::<ark_bls12_381::Fr>(
&bencher.with_name("BLS12-381"),
b,
*k,
*s,
),
Curve::BN254 => {
bench_template::<ark_bn254::Fr>(&bencher.with_name("BN254"), b, *k, *s)
}
Curve::Pallas => bench_template::<ark_pallas::Fr>(
&bencher.with_name("PALLAS"),
b,
*k,
*s,
),
}
}
}
}
}
......
......@@ -6,7 +6,7 @@ use ark_poly_commit::kzg10::{self, KZG10};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate};
use ark_std::ops::Div;
use clap::{command, Parser};
use clap::{command, Parser, ValueEnum};
use komodo::zk::{self, Powers};
use plnk::Bencher;
......@@ -117,21 +117,14 @@ where
}
}
fn setup(degrees: &[usize], nb_measurements: usize) {
fn aux<F: PrimeField, G: CurveGroup<ScalarField = F>>(
degree: usize,
curve: &str,
nb_measurements: usize,
) {
let b = plnk::Bencher::new(nb_measurements).with_name(format!("setup on {}", curve));
setup_template::<F, G, DensePolynomial<F>>(&b, degree);
}
fn setup<F: PrimeField, G: CurveGroup<ScalarField = F>>(
degrees: &[usize],
nb_measurements: usize,
curve: &str,
) {
for d in degrees {
aux::<ark_bls12_381::Fr, ark_bls12_381::G1Projective>(*d, "BLS12-381", nb_measurements);
aux::<ark_bn254::Fr, ark_bn254::G1Projective>(*d, "BN-254", nb_measurements);
aux::<ark_pallas::Fr, ark_pallas::Projective>(*d, "PALLAS", nb_measurements);
aux::<ark_vesta::Fr, ark_vesta::Projective>(*d, "VESTA", nb_measurements);
let b = plnk::Bencher::new(nb_measurements).with_name(format!("setup on {}", curve));
setup_template::<F, G, DensePolynomial<F>>(&b, *d);
}
}
......@@ -149,22 +142,26 @@ fn serde(degrees: &[usize], nb_measurements: usize) {
for d in degrees {
aux::<ark_bls12_381::Fr, ark_bls12_381::G1Projective>(*d, "BLS12-381", nb_measurements);
aux::<ark_bn254::Fr, ark_bn254::G1Projective>(*d, "BN-254", nb_measurements);
aux::<ark_bn254::Fr, ark_bn254::G1Projective>(*d, "BN254", nb_measurements);
aux::<ark_pallas::Fr, ark_pallas::Projective>(*d, "PALLAS", nb_measurements);
aux::<ark_vesta::Fr, ark_vesta::Projective>(*d, "VESTA", nb_measurements);
}
}
fn ark_setup(degrees: &[usize], nb_measurements: usize) {
fn aux<E: Pairing>(degree: usize, curve: &str, nb_measurements: usize) {
fn ark_setup<E: Pairing>(degrees: &[usize], nb_measurements: usize, curve: &str) {
for d in degrees {
let b = plnk::Bencher::new(nb_measurements).with_name(format!("ARK setup on {}", curve));
ark_setup_template::<E, DensePolynomial<E::ScalarField>>(&b, degree);
ark_setup_template::<E, DensePolynomial<E::ScalarField>>(&b, *d);
}
}
for d in degrees {
aux::<ark_bls12_381::Bls12_381>(*d, "BLS12-381", nb_measurements);
aux::<ark_bn254::Bn254>(*d, "BN-254", nb_measurements);
}
#[derive(ValueEnum, Clone, Hash, PartialEq, Eq)]
enum Curve {
BLS12381,
BN254,
Pallas,
ARKBLS12381,
ARKBN254,
}
#[derive(Parser)]
......@@ -178,13 +175,50 @@ struct Cli {
/// the measurements
#[arg(short, long)]
nb_measurements: usize,
#[arg(short, long, num_args=1.., value_delimiter = ',')]
curves: Vec<Curve>,
}
fn main() {
let cli = Cli::parse();
setup(&cli.degrees, cli.nb_measurements);
ark_setup(&cli.degrees, cli.nb_measurements);
for curve in cli.curves {
match curve {
Curve::ARKBN254 => {
ark_setup::<ark_bn254::Bn254>(&cli.degrees, cli.nb_measurements, "BN254");
}
Curve::ARKBLS12381 => {
ark_setup::<ark_bls12_381::Bls12_381>(
&cli.degrees,
cli.nb_measurements,
"BLS12-381",
);
}
Curve::Pallas => {
setup::<ark_pallas::Fr, ark_pallas::Projective>(
&cli.degrees,
cli.nb_measurements,
"PALLAS",
);
}
Curve::BN254 => {
setup::<ark_bn254::Fr, ark_bn254::G1Projective>(
&cli.degrees,
cli.nb_measurements,
"BN254",
);
}
Curve::BLS12381 => {
setup::<ark_bls12_381::Fr, ark_bls12_381::G1Projective>(
&cli.degrees,
cli.nb_measurements,
"BLS12-381",
);
}
}
}
// NOTE: this is disabled for now because it takes so much time...
// serde(&cli.degrees, cli.nb_measurements);
}
......@@ -41,7 +41,7 @@ fn main() {
for n in [1, 2, 4, 8, 16] {
aux::<ark_bls12_381::Fr, ark_bls12_381::G1Projective>(n, "BLS12-381");
aux::<ark_bn254::Fr, ark_bn254::G1Projective>(n, "BN-254");
aux::<ark_bn254::Fr, ark_bn254::G1Projective>(n, "BN254");
aux::<ark_pallas::Fr, ark_pallas::Projective>(n, "PALLAS");
}
}
use ../math.nu *
use ../fs.nu check-file
use ../plot.nu gplt
use ../plot.nu [ into-axis-options, COMMON_OPTIONS, gplt ]
export def main [data: path, --save: path] {
let options = [
# --title "time to commit polynomials for certain curves"
--x-label "degree"
--y-label "time (in ms)"
--fullscreen
--dpi 150
--fig-size ...[16, 9]
--font ({ size: 30, family: serif, sans-serif: Helvetica } | to json)
--use-tex
(if $save != null { [ --save $save ] })
]
check-file $data --span (metadata $data).span
open $data
let graphs = open $data
| where name !~ '^SEC'
| ns-to-ms $.times
| compute-stats $.times
......@@ -28,5 +16,15 @@ export def main [data: path, --save: path] {
| reject items.name
| rename --column { group: "name", items: "points" }
| sort-by name
| gplt plot ($in | to json) ...($options | flatten | compact)
let options = [
# --title "time to create trusted setups for certain curves"
--x-label "degree"
--y-label "time (in ms)"
...($graphs.points | flatten | into-axis-options -x "plain" -y "duration")
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
]
gplt plot ($graphs | to json) ...($options | flatten | compact)
}
export def main [--output: path = "./commit.ndjson", --nb-measurements: int = 10]: list<int> -> nothing {
cargo run --release --example bench_commit -- --nb-measurements $nb_measurements ...$in out> $output
export def main [
--output: path = "./commit.ndjson",
--nb-measurements: int = 10,
--curves: list<string>,
]: list<int> -> nothing {
cargo run --release --example bench_commit -- ...[
--nb-measurements $nb_measurements
...$in
--curves ...$curves
] out> $output
print $"results saved to `($output)`"
}
......@@ -22,7 +22,7 @@ export def encoding [data: path, --save: path] {
let options = [
# --title "1-encoding"
...($graphs.points | flatten | into-axis-options -y "duration")
...($graphs.points | flatten | into-axis-options -x "filesize" -y "duration")
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
]
......@@ -49,7 +49,7 @@ export def decoding [data: path, --save: path] {
let options = [
# --title "k-encoding"
...($graphs.points | flatten | into-axis-options -y "duration")
...($graphs.points | flatten | into-axis-options -x "filesize" -y "duration")
--no-legend
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
......@@ -87,7 +87,7 @@ export def e2e [data: path, --save: path] {
let options = [
# --title "k-encoding + 1-encoding"
...($graphs.points | flatten | into-axis-options -y "duration")
...($graphs.points | flatten | into-axis-options -x "filesize" -y "duration")
--no-legend
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
......@@ -190,7 +190,7 @@ export def combined [data: path, --recoding: path, --save: path] {
}
let options = [
...($graphs.points | flatten | into-axis-options -y "duration")
...($graphs.points | flatten | into-axis-options -x "filesize" -y "duration")
--legend-loc "upper left" "lower right"
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
......@@ -254,7 +254,7 @@ export def ratio [data: path, --recoding: path, --save: path] {
| update name { $"$k = ($in)$" }
let options = [
...($graphs.points | flatten | into-axis-options)
...($graphs.points | flatten | into-axis-options -x "filesize" -y "plain")
--legend-loc "upper right"
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
......
......@@ -3,7 +3,8 @@ use ../formats.nu *
export def main [
--output: path = "./fec.ndjson",
--nb-measurements: int = 10,
--ks: list<int>
--ks: list<int>,
--curves: list<string>,
]: list<int> -> nothing {
let input = $in
......@@ -21,6 +22,7 @@ export def main [
--encoding vandermonde
-k $k
-n 1
--curves ...$curves
] | from ndnuon | to ndjson out>> $output
}
}
......@@ -30,15 +30,23 @@ export def into-filesize-tick-labels []: list<int> -> list<string> {
| each { to text | str replace ".0 " " " }
}
export def into-axis-options [-y: string]: table<x: float, y: float> -> list<string> {
export def into-axis-options [-x: string, -y: string]: table<x: float, y: float> -> list<string> {
let input = $in
let xs = $input | flatten | get x | uniq
let x_tick_labels = match $x {
"filesize" => ($xs | into-filesize-tick-labels),
"plain" => $xs,
_ => {
print $"warning: ($y) option is unknown for -y"
$xs
},
}
let options = [
--x-lim ($xs | first) ($xs | last)
--x-ticks ...$xs
--x-tick-labels ...($xs | into-filesize-tick-labels)
--x-tick-labels ...$x_tick_labels
]
let ys = $input | flatten | get y
......
......@@ -21,7 +21,7 @@ export def main [data: path, --save: path] {
let options = [
# --y-label "time (in ms)"
...($graphs.points | flatten | into-axis-options -y "duration")
...($graphs.points | flatten | into-axis-options -x "filesize" -y "duration")
--no-legend
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
......
......@@ -3,7 +3,8 @@ use ../formats.nu *
export def main [
--output: path = "./recoding.ndjson",
--nb-measurements: int = 10,
--ks: list<int>
--ks: list<int>,
--curves: list<string>,
]: list<int> -> nothing {
let input = $in
......@@ -20,6 +21,7 @@ export def main [
...$input
--shards $k
--ks $k
--curves ...$curves
] | from ndnuon | to ndjson out>> $output
}
}
use ../math.nu *
use ../fs.nu check-file
use ../plot.nu gplt
use ../plot.nu [ into-axis-options, COMMON_OPTIONS, gplt ]
export def main [data: path, --save: path] {
let options = [
# --title "time to create trusted setups for certain curves"
--x-label "degree"
--y-label "time (in ms)"
--fullscreen
--dpi 150
--fig-size ...[16, 9]
--font ({ size: 30, family: serif, sans-serif: Helvetica } | to json)
--use-tex
(if $save != null { [ --save $save ] })
]
check-file $data --span (metadata $data).span
open $data
let graphs = open $data
| ns-to-ms times
| compute-stats times
| insert degree { get label | parse "degree {d}" | into record | get d | into int}
......@@ -33,5 +21,15 @@ export def main [data: path, --save: path] {
| reject items.name
| rename --column { group: "name", items: "points" }
| sort-by name
| gplt plot ($in | to json) ...($options | flatten | compact)
let options = [
# --title "time to create trusted setups for certain curves"
--x-label "degree"
--y-label "time (in ms)"
...($graphs.points | flatten | into-axis-options -x "plain" -y "duration")
...$COMMON_OPTIONS
(if $save != null { [ --save $save ] })
]
gplt plot ($graphs | to json) ...($options | flatten | compact)
}
export def main [--output: path = "./setup.ndjson", --nb-measurements: int = 10]: list<int> -> nothing {
cargo run --release --example bench_setup -- --nb-measurements $nb_measurements ...$in out> $output
export def main [
--output: path = "./setup.ndjson",
--nb-measurements: int = 10,
--curves: list<string>,
]: list<int> -> nothing {
cargo run --release --example bench_setup -- ...[
--nb-measurements $nb_measurements
...$in
--curves ...$curves
] out> $output
print $"results saved to `($output)`"
}
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