Closed
Description
So, I just discovered this:
julia> using BenchmarkTools
julia> @btime parse(Float64, "50.303")
32.163 ns (0 allocations: 0 bytes)
50.303
julia> @btime parse(Float32, "50.303")
71.524 ns (0 allocations: 0 bytes)
50.303f0
julia> @btime convert(Float32, parse(Float64, "50.303"))
32.430 ns (0 allocations: 0 bytes)
50.303f0
If parsing as Float64 and converting to Float32 is twice as fast, why not do it that way by default?
I googled around a bit and couldn't find anything on this so hopefully I'm not missing something obvious here.