www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Truly automatic benchmarking

reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
Have anybody implemented anything near the expressiveness and 
ease of use of Rust's builtin benchmarking features

https://doc.rust-lang.org/1.16.0/book/benchmark-tests.html

I'm mostly interested in completely automatic printing of results 
such as

test tests::bench_add_two ... bench:         1 ns/iter (+/- 0)

and letting the benchmarking library (like in Rust) itself figure 
out the suitable number of iterations a function should be tested 
based on some heuristics on how long one iteration takes and some 
default upper wall clock time limit.
Mar 27 2018
parent reply bauss <jj_1337 live.dk> writes:
On Tuesday, 27 March 2018 at 08:18:43 UTC, Nordlöw wrote:
 Have anybody implemented anything near the expressiveness and 
 ease of use of Rust's builtin benchmarking features

 https://doc.rust-lang.org/1.16.0/book/benchmark-tests.html

 I'm mostly interested in completely automatic printing of 
 results such as

 test tests::bench_add_two ... bench:         1 ns/iter (+/- 0)

 and letting the benchmarking library (like in Rust) itself 
 figure out the suitable number of iterations a function should 
 be tested based on some heuristics on how long one iteration 
 takes and some default upper wall clock time limit.
Perhaps https://dlang.org/phobos/std_datetime_stopwatch.html#benchmark ?
Mar 27 2018
parent =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Tuesday, 27 March 2018 at 08:41:41 UTC, bauss wrote:
 Perhaps 
 https://dlang.org/phobos/std_datetime_stopwatch.html#benchmark ?
That fulfils neither of my two requirements mentioned in above; it requires explicit iteration count given by the caller and no automatic printing of results.
Mar 27 2018