-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
performanceMust go fasterMust go fasterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Description
Copied from: https://discourse.julialang.org/t/performance-and-memory-regression-with-function-wrappers-in-julia-1-4/44589
Setup:
julia> using BenchmarkTools
julia> using FunctionWrappers: FunctionWrapper
julia> w = let closed_over=([1], [2])
FunctionWrapper{typeof(closed_over), Tuple{}}(() -> closed_over)
end;Results
Julia 1.3.1:
julia> @btime $w()
5.435 ns (0 allocations: 0 bytes)Julia 1.4.2:
julia> @btime $w()
9.919 ns (1 allocation: 16 bytes)Julia 1.5.0
julia> @btime $w()
10.112 ns (1 allocation: 32 bytes)Julia 1.6.0-DEV.607
julia> @btime $w()
11.846 ns (1 allocation: 32 bytes)This turns out to be the source of a significant performance regression in Parametron.jl (which was designed to allocate zero memory).
Here's my system info:
julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
@yuyichao pointed to JuliaLang/FunctionWrappers.jl#14 as a related issue. I cannot reproduce the MWE from JuliaLang/FunctionWrappers.jl#14 (comment) on Julia 1.5, but the slowness and extra allocation of my example here is still present in Julia 1.5.0.
ancapdev, saschatimme, ChrisRackauckas and p-zubieta
Metadata
Metadata
Assignees
Labels
performanceMust go fasterMust go fasterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version