Review of Andrei's std.benchmark

Jacob Carlborg doob at me.com
Wed Sep 19 00:13:40 PDT 2012


On 2012-09-17 23:13, Jens Mueller wrote:

> Post all feedback to this thread. Constructive feedback is very much
> appreciated.
>
> To conclude in more Andrei like words: Happy destruction!

* Why is "scheduleForBenchmarking" a string? Can't it be a template mixin?

* What's the most appropriate way of just timing a block of code? 
Something like this:

auto time = benchmark!({ /* some code */ })(1);

If that's the case then I suggest setting a default value of "1" for the 
"n" parameter.

* If I want to format the printed result differently, say in HTML, how 
would I do that? Should I use the "benchmark" function and iterate the 
BenchmarkResult array?

* BTW why doesn't benchmark return the BenchmarkResult array?

* Is this module so important to keep it as a top level module? I'm 
thinking something like a utility package or a time/date package. How 
about std.util.benchmark?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list