Skip to content

Commit

Permalink
avoid jl_arrayunset in dicts with bitstypes; add some more @inbounds (#…
Browse files Browse the repository at this point in the history
…30113)

* avoid jl_arrayunset in dicts with bitstypes; add some more @inbounds

* also skip jl_arrayunset for isbitsunion

* amend typo
  • Loading branch information
JeffBezanson committed Nov 30, 2018
2 parents 67bba81 + d7198bf commit 6bfe947
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ function getkey(h::Dict{K,V}, key, default) where V where K
end

function _pop!(h::Dict, index)
val = h.vals[index]
@inbounds val = h.vals[index]
_delete!(h, index)
return val
end
Expand Down Expand Up @@ -619,10 +619,10 @@ function pop!(h::Dict)
key => val
end

function _delete!(h::Dict, index)
h.slots[index] = 0x2
ccall(:jl_arrayunset, Cvoid, (Any, UInt), h.keys, index-1)
ccall(:jl_arrayunset, Cvoid, (Any, UInt), h.vals, index-1)
function _delete!(h::Dict{K,V}, index) where {K,V}
@inbounds h.slots[index] = 0x2
isbitstype(K) || isbitsunion(K) || ccall(:jl_arrayunset, Cvoid, (Any, UInt), h.keys, index-1)
isbitstype(V) || isbitsunion(V) || ccall(:jl_arrayunset, Cvoid, (Any, UInt), h.vals, index-1)
h.ndel += 1
h.count -= 1
h.age += 1
Expand Down

2 comments on commit 6bfe947

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.