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

Performance regression 1.5 -> 1.6 calling fieldname(T, i) #38920

Closed
quinnj opened this issue Dec 17, 2020 · 0 comments · Fixed by #38921
Closed

Performance regression 1.5 -> 1.6 calling fieldname(T, i) #38920

quinnj opened this issue Dec 17, 2020 · 0 comments · Fixed by #38921
Labels
performance Must go faster regression Regression in behavior compared to a previous version

Comments

@quinnj
Copy link
Member

quinnj commented Dec 17, 2020

Julia 1.5.2:

julia> function ff(::Type{T}, i) where {T}
       return fieldname(T, i)
       end
ff (generic function with 1 method)

julia> @btime ff(A, 2)
  7.048 ns (0 allocations: 0 bytes)
:b

Julia 1.6.0-DEV.1640

julia> struct A
              a::Int
              b::Float64
              c::String
              end

julia> function ff(::Type{T}, i) where {T}
              return fieldname(T, i)
              end
ff (generic function with 1 method)

julia> @btime ff(A, 2)
  305.302 ns (0 allocations: 0 bytes)
:b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster regression Regression in behavior compared to a previous version
Projects
None yet
3 participants