Make much more functionality optional. #402
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Criterion is painful to use in many cases -- bloating the dependency tree so badly that I move benchmarks into another crate excluded from the workspace -- Otherwise just adding a single criterion benchmark expands the dev-dependency tree so much that it's a huge hit to dev ergonomics.
It has many features -- I don't mind these features on their own. I don't think criterion is a bad library, it just has many bad side effects that should be addressed. The use case I'd want to be available is just looking at CLI output, and then if need to dig in, turn on more features and accept the build time, or something.
Anyway I've probably ranted too much to make you want to accept this work. Sorry. Towards the end these patches got pretty sloppy anyway, which is why I stopped... Also I didn't feel like checking if anything other than default-features and no-default-features worked (probably they are slightly broken).
As is it now, it cuts builds on my machine from 27s to 17s for a debug build and 56s to 40s for a release. Next logical step would be removing serde (this code removes a ton of its use), then ideally rayon although it's not quite as bad and might pay for itself in terms of time IDK.
Outputs from full
cargo clean; cargo +nightly build -Z timing
of before/after here:https://gist.github.com/thomcc/e1f4bda8bafa4e164483a1b942782a61