rust/src/libtest
bors ac5046cf67 Auto merge of #38779 - Craig-Macomber:bench, r=alexcrichton
Do not run outer setup part of benchmarks multiple times to fix issue 20142

Fix #20142

This is my first real rust code, so I expect the quality is quite bad. Please let me know in which ways it is horrible and I'll fix it.

Previously the whole benchmark function was rerun many times, but with this change, only the callback passed to iter is rerun. This improves performances by saving benchmark startup time. The setup used to be called a minimum of 101 times, and now only runs once.

I wasn't sure exactly what should be done for the case where iter is never called, so I left a FIXME for that: currently it does not error, and I added tests to cover that.

I have left the algorithm and statistics unchanged: I don't like how the minimum number of runs is 301 (that's bad for very slow benchmarks) but I consider such changes out of scope for this fix.
2017-01-12 14:42:02 +00:00
..
Cargo.toml mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
lib.rs Auto merge of #38779 - Craig-Macomber:bench, r=alexcrichton 2017-01-12 14:42:02 +00:00
stats.rs do not run outter part of benchmarks multimple times to fix issue 20142 2017-01-02 09:43:40 -08:00