Allow subtracting two @benchmarkables to create a new @benchmarkable #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theBenchmarkGroup
?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
@benchmarkable
s:but that's not a thing, it seems 😞
is there anything like that? Subtracting two
benchmarkable
s to get a newbenchmarkable
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! :)