ralexstokes / ssz-rs

Implementation of ethereum's `ssz`
Apache License 2.0
102 stars 40 forks source link

Create benchmarks for proof generation and verification #162

Open EchoAlice opened 2 weeks ago

EchoAlice commented 2 weeks ago

Addresses issue #160

EchoAlice commented 2 weeks ago

i'm getting warnings about code unrelated to the PR which is making the build check not pass. Should i fix these warnings?

ralexstokes commented 2 weeks ago

looks like the issue is directly related to this PR

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> ssz-rs/src/lib.rs:86:12
   |
86 | #![feature(test)]
   |            ^^^^

For more information about this error, try `rustc --explain E0554`.

and it seems like the issue is that the "native" rustc support for benchmarks is not on a stable version of the compiler yet

it looks like a common alternative is Criterion, e.g https://github.com/bheisler/criterion.rs?tab=readme-ov-file#quickstart

I think it will also be nicer if we have the benchmarks collected outside of the src files, say in a top-level benches directory

EchoAlice commented 2 weeks ago

looks like the issue is directly related to this PR

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> ssz-rs/src/lib.rs:86:12
   |
86 | #![feature(test)]
   |            ^^^^

For more information about this error, try `rustc --explain E0554`.

and it seems like the issue is that the "native" rustc support for benchmarks is not on a stable version of the compiler yet

it looks like a common alternative is Criterion, e.g https://github.com/bheisler/criterion.rs?tab=readme-ov-file#quickstart

I think it will also be nicer if we have the benchmarks collected outside of the src files, say in a top-level benches directory

This was what i was referring to:

warning: the item `Ordering` is imported redundantly
   --> ssz-rs/src/list.rs:337:17
    |
336 |     use super::*;
    |         -------- the item `Ordering` is already imported here
337 |     use crate::{lib::cmp::Ordering, serialize, U256};
    |                 ^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default
ralexstokes commented 1 week ago

looks like the issue is directly related to this PR

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> ssz-rs/src/lib.rs:86:12
   |
86 | #![feature(test)]
   |            ^^^^

For more information about this error, try `rustc --explain E0554`.

and it seems like the issue is that the "native" rustc support for benchmarks is not on a stable version of the compiler yet it looks like a common alternative is Criterion, e.g https://github.com/bheisler/criterion.rs?tab=readme-ov-file#quickstart I think it will also be nicer if we have the benchmarks collected outside of the src files, say in a top-level benches directory

This was what i was referring to:

warning: the item `Ordering` is imported redundantly
   --> ssz-rs/src/list.rs:337:17
    |
336 |     use super::*;
    |         -------- the item `Ordering` is already imported here
337 |     use crate::{lib::cmp::Ordering, serialize, U256};
    |                 ^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

I see a different error, need to update the MSRV