Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make empty
Dict
only have space for 0 rather than 16 elements (and …
…the minimum size for non-empty `Dict` down to 4). (#52912) This improves speed and reduces allocation for small Dicts. ``` #before julia> @Btime Dict{Int,Int}() 46.815 ns (4 allocations: 448 bytes) #after julia> @Btime Dict{Int, Int}() 9.429 ns (1 allocation: 80 bytes) ``` The initialization to 16 before made sense when `Dict` was `Vector` backed since `Vectors` were slow to instantiate, but Memory is much faster).
- Loading branch information