Benchmarking

If you are interested in performance optimization for pubgrub, we suggest reading The Rust Performance Book. Microbenchmarks generally do not represent real world performance, so it's best to start with a slow case in uv or cargo and look at a profile, e.g. with samply.

A first step is optimizing IO/network requests, caching and type size in the downstream code, which is usually the bottleneck over the pubgrub algorithm. Using Arc and splitting types into large and small variants often helps a lot. The next step is to optimize prioritization, to reduce the amount of work that pubgrub has to do, here pubgrub should give better information to make this easier for users. These usually need to be done before pubgrub itself becomes a bottleneck.

Side note about code layout and performance

I highly recommend watching the talk "Performance Matters" by Emery Berger presented at strangeloop 2019 for more information on "sound performance analysis" and "effective performance profiling". There is an issue in criterion about the "stabilizer" tool. And for causal profiling, it seems possible to directly use coz for rust programs.