std.benchmark is in reviewable state

Jose Armando Garcia jsancio at gmail.com
Mon Sep 26 09:04:00 PDT 2011


On Sun, Sep 25, 2011 at 6:08 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Comments and suggestions are welcome.

Very nice. Really like the functionality. Really like how you
implemented "void benchmarkModule(string mod)(File target = stdout)".
I have a few comments.

My main concern on how this function works is that it looks at the
module for methods starting with benchmark_. I like the idea in
general but I am worry that it would pollute the symbol space. Does
this work with private symbols? Can the user  make all the members
private and it will still work? What about versioning should the user
version all the benchmark members with version(Benchmark) or something
like that? Should the user just create a benchmark module that would
just contain all these benchmark functions. What do you recommend to
the user? Should the doc contain these recommendations?

One last comment for now. Maybe we can make the prefix, 'benchmark_',
configurable by passing it to benchmarkModule(...).

I think that benchmarkModule would greatly benefit from annotation it
would be nice if the user could write:

@benchmark("list")
private void listInsert() {...}


More information about the Digitalmars-d mailing list