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

Make part of BenchmarkTools.jl? #9

Closed
ViralBShah opened this issue Oct 17, 2016 · 10 comments
Closed

Make part of BenchmarkTools.jl? #9

ViralBShah opened this issue Oct 17, 2016 · 10 comments

Comments

@ViralBShah
Copy link

In conversation with @shashi we were wondering if this package should just become part of BenchmarkTools.jl?

@ViralBShah
Copy link
Author

cc @jrevels

@shashi
Copy link
Collaborator

shashi commented Oct 17, 2016

Just checked - this won't add any extra dependencies to BenchmarkTools on Julia 0.5+ 👍

@shashi
Copy link
Collaborator

shashi commented Oct 17, 2016

I think this package definitely belongs inside BenchmarkTools in some form or as it is. The functions and macros in this package fall squarely in the category of "benchmark tools", and the current split doesn't feel very satisfying. I can make a PR to BenchmarkTools if @jrevels has no objections.

@jrevels
Copy link
Member

jrevels commented Nov 2, 2016

I'm fine with merging the functionality here into BenchmarkTools (sorry for the late response).

@jrevels
Copy link
Member

jrevels commented Nov 2, 2016

I'm fine with merging the functionality here into BenchmarkTools (sorry for the late response).

Note that I'm referring to the benchmarkpkg functionality. I'd prefer not to add the additional macros here to BenchmarkTools. The similarity of @benchmark, @bench, @benchmarkable and @benchgroup could easily be a point of confusion for new users. The original BenchmarkTrackers package had basically the exact same macros, but after spending a lot of time working with that interface, I ended up rewriting the BenchmarkGroup API to move away from macros.

Compare the example in the README to how one would write it in native BenchmarkTools:

module MyBenchmarks

# instantiate global state unbeknownst to naive users
using BenchmarkTools 

# magically generate/push group to global state
@benchgroup "utf8" ["string", "unicode"] begin
    teststr = UTF8String(join(rand(MersenneTwister(1), 'a':'d', 10^4)))
    @bench "replace" replace($teststr, "a", "b")
    @bench "join" join($teststr, $teststr)
end

end # module

...versus...

module MyBenchmarks

using BenchmarkTools 

# just tell users that `benchmarkpkg` will look for and execute MyBenchmarks.SUITE
const SUITE = BenchmarkGroup()

# hook up group explicitly, no magic
let g = addgroup!(SUITE, "utf8", ["string", "unicode"])
    teststr = UTF8String(join(rand(MersenneTwister(1), 'a':'d', 10^4)))
    g["replace"] = @benchmarkable replace($teststr, "a", "b")
    g["join"] = @benchmarkable join($teststr, $teststr)
end

end # module

It's true that the latter is slightly more verbose, but at the huge benefit (IMO) of transparency/explicitness/similarity to working with Dicts.

@juliohm
Copy link

juliohm commented Jun 4, 2017

No matter where this functionality goes, it is good to have a larger group of people looking into benchmark tools for Julia.

@KristofferC
Copy link
Collaborator

@jrevels, FYI, the benchmark macros are now removed, the way to use this pacakge now is by using the official BenchmarkToosl dict interface.

@goerz
Copy link
Contributor

goerz commented Feb 11, 2018

Is the plan to move everything (specifically the benchmarkpgk method) into BenchmarkTools, making this package obsolete towards the release of Julia 0.7?

@KristofferC
Copy link
Collaborator

KristofferC commented Feb 11, 2018

Probably not.

@KristofferC
Copy link
Collaborator

Don't think this will happen.

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

No branches or pull requests

6 participants