getfield would be more efficient than eval in getting the value of a variable/type here:
|
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
getfieldwould be more efficient thanevalin getting the value of a variable/type here:Query.jl/src/table_query_macros.jl
Line 75 in a4c0ea1
Toy example: