chore: move `lazy_static` to `once_cell`, and some clippy fix
Hello @attila-lin, could you please provide some motivation why changes from lazy_static to once_cell`?
Also, I assume you ran Clippy with the Nightly toolchain?
Hello @attila-lin, could you please provide some motivation why changes from
lazy_staticto once_cell`?
maintenance = { status = "passively-maintained" }
this crate is passively-maintained. The std choose the once_cell impl.
Also, I assume you ran Clippy with the Nightly toolchain?
Yes.
Hello @attila-lin, could you please provide some motivation why changes from
lazy_staticto once_cell`?maintenance = { status = "passively-maintained" }
this crate is passively-maintained. The
stdchoose theonce_cellimpl.
The fact that it is passively maintained is not an issue to me, but the second argument looks ok. But I assume we would go for std::cell::LazyCell once https://github.com/rust-lang/rust/issues/109736 is merged (so stabilized).
Also, I assume you ran Clippy with the Nightly toolchain?
Yes.
Fair enough
Benchmarks show a large decreasing in performances, which is surprising:
group before changes
----- ------ -------
count_ok/identifiers 1.06 866.3±5.20ns 857.6 MB/sec 1.00 818.1±20.90ns 908.1 MB/sec
count_ok/keywords_operators_and_punctators 1.00 2.5±0.05µs 805.5 MB/sec 1.02 2.6±0.04µs 790.1 MB/sec
count_ok/strings 1.00 554.8±12.18ns 1497.3 MB/sec 1.24 689.4±33.73ns 1204.9 MB/sec
iterate/identifiers 1.02 869.3±19.49ns 854.6 MB/sec 1.00 850.5±4.32ns 873.5 MB/sec
iterate/keywords_operators_and_punctators 1.05 2.7±0.02µs 762.7 MB/sec 1.00 2.5±0.02µs 799.9 MB/sec
iterate/strings 1.00 585.3±21.16ns 1419.1 MB/sec 1.22 716.3±23.00ns 1159.6 MB/sec
I just restarted the benchmarks, to see if that stays the same.
interesting!
This is very surprising... Do you observe the same benchmark changes locally?
let me try unsync version!
Any update @attila-lin?