-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
Milestone
Description
getfield
would be more efficient than eval
in getting the value of a variable/type here:
Query.jl/src/table_query_macros.jl
Line 75 in a4c0ea1
prev = :( merge($prev, QueryOperators.NamedTupleUtilities.oftype(_, Val($(eval(Symbol(m_type[1])))))) ) |
Toy example:
julia> using BenchmarkTools
julia> @btime getfield(Main, Symbol("Int"))
0.015 ns (0 allocations: 0 bytes)
Int64
julia> @btime eval(Symbol("Int"))
58.841 ns (0 allocations: 0 bytes)
Int64