Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow subtracting two @benchmarkables to create a new @benchmarkable #129

Closed
wants to merge 1 commit into from

Conversation

NHDaly
Copy link

@NHDaly NHDaly commented Dec 11, 2018

I'm not sure if this is even desirable, and if it is, i'm not sure i've done it the best way, but this is something we want to do:

Here's the context for this:

I'm trying to define a BenchmarkGroup for https://juliaci.github.io/PkgBenchmark.jl. But in my existing benchmark file, I'm subtracting the results of two @benchmark runs (one where I do my operation, and one where I don't) in order to get the exact time for just my operation. Is there any way I can reproduce that type of logic with the @benchmarkable structure I need for the BenchmarkGroup?

Here's my existing logic that I'm trying to convert to be a BenchmarkGroup:
https://github.com/JuliaMath/FixedPointDecimals.jl/blob/3e7da851ea9caa0e267c21e0bb067ae32ee9ad77/bench/decimal-representation-comparisons.jl#L96-L99

Ideally, i'd love to just subtract two @benchmarkables:

        bbase = @benchmarkable $fbase()
        bbench = @benchmarkable $fbench()
        SUITE["bench"] = bbench - bbase

but that's not a thing, it seems 😞

is there anything like that? Subtracting two benchmarkables to get a new benchmarkable that returns the diff of the two?


So this PR adds the ability to do that. I'd love to talk through it with you and figure out the best way to do something like what we're trying to do here! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant