Skip to content
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

fix type inference regression in Ryu #37802

Merged
merged 1 commit into from
Sep 29, 2020
Merged

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Sep 29, 2020

In #37163, a performance regression snuck in, likely due to a misunderstanding in that this array is not only used during compilation time but also at runtime. Making it Any is therefore detrimental for performance. This restores things while also avoiding the interpolation of the array into the AST because it makes e.g. @code_warntype annoying to read. Also, make the array into a tuple because that tends to codegen slightly better.

Before:

julia> a = rand();

julia> @btime Base.Ryu.writeshortest($a)
  1.544 μs (40 allocations: 1.02 KiB)
"0.7946694032978381"

after

julia> @btime Base.Ryu.writeshortest($a)
  49.430 ns (2 allocations: 432 bytes)
"0.5526067771685965"

@KristofferC KristofferC added the performance Must go faster label Sep 29, 2020
@KristofferC KristofferC merged commit da1d837 into master Sep 29, 2020
@KristofferC KristofferC deleted the kc/fix_ryu_regression branch September 29, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants