-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
reduce allocations for string(::IEEEFloat) #57977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
reduce allocations for string(::IEEEFloat) #57977
Conversation
Can this PR also fix julia> buf = Vector{UInt8}(undef, 10)
10-element Vector{UInt8}:
0x69
0x09
0x00
0x00
0x00
0x00
0x00
0x00
0x6a
0x09
julia> format = Printf.format"%.4f"
Printf.Format{Base.CodeUnits{UInt8, String}, Tuple{Printf.Spec{Val{'f'}}}}(UInt8[0x25, 0x2e, 0x34, 0x66], UnitRange{Int64}[1:0, 5:4], (%.4f,), 1)
julia> @time Printf.format(buf, 1, format, 1.0)
0.000016 seconds
7 However, the signature of |
I think |
Would be good with tests for the cases where the constants were wrong since that seems like good edge cases to test. |
tests added. |
5b631b7
to
6176380
Compare
good to merge? |
So, I guess, no? |
oops. Tests now look a lot happier. |
mitigates #57976