在性能提示中,它说f(x::Int...) = tuple(x...)不会专门化。它还建议用于(@which f(...)).specializations检查专业化。
f(x::Int...) = tuple(x...)
f(1)
f(1, 2)
f(1, 2, 3)
f(1, 2, 3, 4)
a = first(methods(f)).specializations
Core.TypeMapEntry(Core.TypeMapEntry(nothing, Tuple{typeof(f),Int64}, nothing, svec(), 0x0000000000000001, 0xffffffffffffffff, MethodInstance for f(::Int64), true, true, false), Tuple{typeof(f),Int64,Vararg{Int64,N} where N}, nothing, svec(), 0x0000000000000001, 0xffffffffffffffff, MethodInstance for f(::Int64, ::Vararg{Int64,N} where N), false, true, true)
Run Code Online (Sandbox Code Playgroud)
我如何解释TypeMapEntry? 如何以编程方式访问它(我发现很难从输出中读取)?它做了多少专业?