rust-lang / rustc-perf

Website for graphing performance of rustc

Home Page:https://perf.rust-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add a benchmark for `typenum`

lcnr opened this issue · comments

commented

typenum is a quite widely used crate whose performance is strongly impacted by -Znext-solver=coherence and type system changes in general. It would be useful to add it to the suite.

Does the crate itself contain the interesting code (i.e. does it "use itself" enough), or would you like to see some other crate that leverages typenum?

commented

the crate itself has been good enough in my experience

Okay, I wouldn't mind adding it even as a primary benchmark, since it's probably going to be a dependency of several real world crates. And in light of stabilizing parts of the new solver, it makes sense to add stress tests for trait solving.

@nnethercote What do you think?

Sounds fine. Instructions for adding a new benchmark are here.

I will add it. I also noticed it's a top 100 crates.io crate with over 300k daily downloads, so it's even more popular than I thought.

Hmm, it has a rather complicated build script that I will have to pre-run and commit its outputs, since we don't support benchmarking crates with build scripts. The output of the build script depends on enabled features though. @lcnr https://github.com/paholg/typenum/blob/main/Cargo.toml#L27 any specific features that you want to have enabled for it?

commented

maybe just i128 and const-generics? 🤔 given that these are the default features for the playground/docs?

Ok! I'll enable these then. I tried it locally and it compiles pretty quickly, takes a few secs to run all the benchmark configurations, so should be fine time-wise.

As expected, it's very frontend heavy:

  • Check/IncrPatched
    typenum-1 17 0-check-incr-patched
  • Debug/Full
    typenum-1 17 0-debug-full