Repository navigation
Conversation
|
Unless this is part of the generic |
|
This should also apply to Dict |
|
Interestingly, it seems julia> b = collect(1:10^4);
julia> empty!(b)
Int64[]
julia> unsafe_load(convert(Ptr{Csize_t}, pointer_from_objref(b)+8*2+2+2+4+8)) |> Int
10000Not sure why Do you have any suggestions for a name, I was thinking |
|
I assumed differences are due to how dictionaries resize using different approaches. I can't think of any collection that uses 'empty!' that wouldn't benefit from this extra argument. Not sure why it needs different name. |
|
I think the observation was that an oversized Dict performs worse in real-world conditions than one that is |
|
c.f. e62a7db for measurements |
|
I'm always for improving memory management tools but I'm curious what scenario one deletes all keys and values only to replace them with the same number of unique key value pairs |
|
It's useful in #51120, essentially I have an |
I couldn't find a function for just emptying an IdDict without resizing it so I just added that as an option.