Is this expected, or is this a bug? Printing Val(:hello_world)
is ~1000 times slower than printing :hello_world
, and I imagine this affects things like printing stack traces with complicated types.
julia> @benchmark string(Val(:a))
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min … max): 311.461 μs … 1.826 ms ┊ GC (min … max): 0.00% … 80.96%
Time (median): 321.411 μs ┊ GC (median): 0.00%
Time (mean ± σ): 323.074 μs ± 32.385 μs ┊ GC (mean ± σ): 0.22% ± 1.87%
▁▃▄▆█▇▆▇▇▇▄▄▅▄▅▃▄▂▁
▂▂▂▂▂▃▃▄▄▄▅▅▅▆▆████████████████████▆▆▆▅▅▄▄▄▃▃▃▃▃▃▃▂▂▂▂▂▂▂▂▁▂ ▅
311 μs Histogram: frequency by time 336 μs <
Memory estimate: 26.73 KiB, allocs estimate: 25.
julia> @benchmark string(:a)
BenchmarkTools.Trial: 10000 samples with 998 evaluations.
Range (min … max): 14.309 ns … 778.920 ns ┊ GC (min … max): 0.00% … 95.49%
Time (median): 16.483 ns ┊ GC (median): 0.00%
Time (mean ± σ): 17.907 ns ± 16.759 ns ┊ GC (mean ± σ): 2.03% ± 2.14%
▁ █
▂▁▂▂▃▆███▇▆▅▅▄▄▄▃▃▄▆▃▃▃▄▃▂▂▂▂▂▂▃▃▃▄▄▄▄▄▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ ▃
14.3 ns Histogram: frequency by time 25.6 ns <
Memory estimate: 24 bytes, allocs estimate: 1.