Skip to content

Commit

Permalink
Decrease inlining cost of key indexing function
Browse files Browse the repository at this point in the history
Unfortunately, cost is ~106 now so still too high, JuliaLang#51912 is tracking issue about high cost.

Lowers inlining cost of setproperty as we know rhs isa Memory{Any}
  • Loading branch information
Zentrik committed Oct 31, 2023
1 parent 7f20833 commit 519dfe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/iddict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function ht_keyindex!(d::IdDict{K, V}, @nospecialize(key)) where {K, V}
ref = Ref{Ptr{Any}}(pointer_from_objref(ht))
# # keyindex - where a key is stored, or -pos if the key was not present and was inserted at pos
keyindex = ccall(:jl_table_assign_bp, Cssize_t, (Ptr{Ptr{Any}}, Any, Any, Cint), ref, key, C_NULL, 0)
d.ht = unsafe_pointer_to_objref(ref[])
d.ht = unsafe_pointer_to_objref(ref[])::Memory{Any}

@_gc_preserve_end t

Expand Down

0 comments on commit 519dfe7

Please sign in to comment.