JMH
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jan 22 08:44:32 PST 2016
On 2016-01-22 02:54, Chris Wright wrote:
> https://issues.dlang.org/show_bug.cgi?id=10023 for more context.
>
> In short, this makes user-defined attributes discoverable at runtime at
> the module level, if the attribute has opted in. I think. I'm not sure
> how it would help here, though, so I kind of doubt my interpretation.
It's discoverable at compile time as well. Currently one would need to
give a list of modules where the benchmark module would look for the
@benchmark attributes, or something similar. With the PR I linked to
that would not be necessary. One would just compile all code of interest
that contains the attributes + the benchmark module. The benchmark
module would basically register a callback that is called each time the
compiler sees a new module. The callback would then iterate all symbols
in the modules looking for the @benchmark attributes.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list