Symbols are interned, so that for a given string value of a symbol, there
is only one copy. There will only be memory allocations if the symbol is
not already present in Julia's symbol table.
If you have many dictionary structures that use mostly the same set of
keys, then symbols work quite well.
On Tuesday, August 16, 2016 at 5:44:46 PM UTC+2, Oliver Schulz wrote:
>
> Hi,
>
> I was thinking of using Symbols as keys in a Dict{Symbol,Int64}, instead
> of Strings. However, Symbol is not a bitstype, so there I guess there will
> still be a lot of individual memory allocation when working with such a
> Dict, right?
>
> Actually, why isn't Symbol a bitstype (according to
> https://github.com/JuliaLang/julia/issues/5880, symbols are not GCed)?
>
>
> Cheers,
>
> Oliver
>
>