Skip to content

Simple version of @btime with automatic interpolation #118

@jlperla

Description

@jlperla

I know this has been brought up before (e.g. #65 ) and others, but let me make a slightly different suggestion. The current @btime and @benchmark are great, but what about a simple @rdeits made a similar suggestion in #65 (comment)

The issue is that the vast majority of benchmarking I do is of the form @btime f(a,b) and no matter how many times I have read the manual, I will always forget to do it as @btime f($a, $b). Not to mention that it is harder to read or flip benchmarks on/off easily for a function you are working on.

So my suggestion is a macro @bfunction or whatever, which only accepts a function as head and automatically interpolates all arguments. i.e.

@bfunction f(a,b) -> @btime f($a, $b)

Is that sort of thing possible to do with the macro expansion model in Julia? If I was able to get a PR would you consider merging it, or do you disagree with the feature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions