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

RFC/WIP: Added IdDict to collection benchmarks #171

Merged
merged 1 commit into from
Jun 26, 2018

Conversation

mauro3
Copy link
Contributor

@mauro3 mauro3 commented Jan 18, 2018

Adds the new IdDict to the collection benchmarks, x-ref: JuliaLang/julia#25210

IdDict is missing the pop!(iddict) method, thus a few more guards. Probably this method should be added to IdDict.

TODO: this should probably be made compatible with older Julia versions.

CC: @rfourquet

@ararslan
Copy link
Member

BaseBenchmarks needs to support 0.6 until we're certain there won't be any further 0.6 releases. While it's unlikely, it is the current release version, so we can't be sure of that yet. What I would suggest is to add IdDict to Compat first, then use the Compat version here.

@mauro3
Copy link
Contributor Author

mauro3 commented Jan 18, 2018

Thanks for the speedy feedback!

It's not possible to add the needed features of IdDict to Compat.jl (its type parameters, see comment #150 (comment)). My idea was to just not run IdDict tests on 0.6. If that is not an option, would it be ok to let this PR sit until 0.6 is dropped? Or we could close it and I'll try to remember to re-open later. Let me know what you think is best.

@ararslan
Copy link
Member

Ah, okay. In that case, I'd be fine with letting this sit until 0.6 is dropped, or just putting all of the relevant stuff here behind an appropriate version guard thereby disabling it on 0.6. I'd be fine either way. 🙂

@mauro3 mauro3 force-pushed the m3/IdDict branch 2 times, most recently from 004352e to 71583ff Compare January 19, 2018 22:17
@mauro3
Copy link
Contributor Author

mauro3 commented Jan 19, 2018

Ok, updated with version guards. Maybe worth waiting for the verdict on JuliaLang/Compat.jl#464.

Copy link
Contributor

@rfourquet rfourquet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -41,24 +48,27 @@ initcoll(C, T) = let initmap = Dict(Vector => Vector,
Dict => Pair,
Set => Vector,
BitSet => Vector)
IDD && (initmap[IdDict] = Pair)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As IdDict is here to stay, why not put directly IdDict => Pair in the initialization of initmap? As you defined trivially IdDict anyway on 0.6, it won't be an error, it will just not be used, and this is less code to update when version 0.6 support is dropped. Or am I missing something?

T in (Int, String, Any)
coll[C, T] = C(initcoll(C, T))
end

@inline newcoll(::Type{C}, ::Type{T}) where {C,T} = C{T}()
@inline newcoll(::Type{Dict}, ::Type{T}) where {T} = Dict{T,T}()
IDD && (@inline newcoll(::Type{IdDict}, ::Type{T}) where {T} = IdDict{T,T}())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark as above, maybe the guard is unnecessary here? (idem for askey below).

@mauro3
Copy link
Contributor Author

mauro3 commented Jan 22, 2018

Adressed @rfourquet comments. I think this could be merged after CI passes (If Compat does something about IdDict (JuliaLang/Compat.jl#464), then it's a one-line update.)

@KristofferC KristofferC reopened this Jun 26, 2018
@KristofferC KristofferC merged commit 5506f04 into JuliaCI:master Jun 26, 2018
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.

4 participants