-
Notifications
You must be signed in to change notification settings - Fork 70
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 in Julia v0.5 #385
Comments
Does this mean ApproxFun breaks type-stability of |
I don't know what exactly happens for either case but they look similar. |
@yuyichao So is the solution to stick to 0.4 until JuliaLang/julia#18465 is resolved? |
I've heard that it is what a few people does. I didn't hit it myself and I didn't look into it (@vtjnash should have) so I don't really have more to say other than pointing to the issue..... |
This appears not to be an issue in 0.6. Without ApproxFun: julia> versioninfo()
Julia Version 0.6.0-pre.alpha.173
Commit 93cddfc* (2017-03-18 17:19 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin16.4.0)
CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
julia> f(x::Complex{Float64}) = exp(im*(1.0/x+x-x^3/12.0))::Complex{Float64}
f (generic function with 1 method)
julia> z = 1.0+im
1.0 + 1.0im
julia> @time f(z)
0.070867 seconds (86.66 k allocations: 3.526 MiB)
-0.06858891931151362 + 0.7132409685234511im
julia> @time f(z)
0.000005 seconds (5 allocations: 192 bytes)
-0.06858891931151362 + 0.7132409685234511im
With ApproxFun, the run-time and allocations are back to normal, but the compile time is higher. julia> using ApproxFun
julia> f(x::Complex{Float64}) = exp(im*(1.0/x+x-x^3/12.0))::Complex{Float64}
f (generic function with 1 method)
julia> z = 1.0+im
1.0 + 1.0im
julia> @time f(z)
0.167900 seconds (183.24 k allocations: 7.191 MiB)
-0.06858891931151362 + 0.7132409685234511im
julia> @time f(z)
0.000004 seconds (5 allocations: 192 bytes)
-0.06858891931151362 + 0.7132409685234511im
|
It should also be fixed in 0.5.1
…Sent from my iPhone
On 20 Mar 2017, at 08:15, Richard Mikael Slevinsky ***@***.***> wrote:
This appears not to be an issue in 0.6. Without ApproxFun:
julia> versioninfo()
Julia Version 0.6.0-pre.alpha.173
Commit 93cddfc* (2017-03-18 17:19 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin16.4.0)
CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
julia> f(x::Complex{Float64}) = exp(im*(1.0/x+x-x^3/12.0))::Complex{Float64}
f (generic function with 1 method)
julia> z = 1.0+im
1.0 + 1.0im
julia> @time f(z)
0.070867 seconds (86.66 k allocations: 3.526 MiB)
-0.06858891931151362 + 0.7132409685234511im
julia> @time f(z)
0.000005 seconds (5 allocations: 192 bytes)
-0.06858891931151362 + 0.7132409685234511im
With ApproxFun, the run-time and allocations are back to normal, but the compile time is higher.
julia> using ApproxFun
julia> f(x::Complex{Float64}) = exp(im*(1.0/x+x-x^3/12.0))::Complex{Float64}
f (generic function with 1 method)
julia> z = 1.0+im
1.0 + 1.0im
julia> @time f(z)
0.167900 seconds (183.24 k allocations: 7.191 MiB)
-0.06858891931151362 + 0.7132409685234511im
julia> @time f(z)
0.000004 seconds (5 allocations: 192 bytes)
-0.06858891931151362 + 0.7132409685234511im
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This isn't officially an ApproxFun issue, but the following is a performance anomaly in v0.5. Without loading ApproxFun, the simple function
f
evaluates fast and allocation-free:We try the same thing with the development branch of ApproxFun loaded first, and
f
is significantly slower and allocates:The type-assertion is irrelevant (unless one cares to look at the result of @code_warntype). It would be great for this to be demystified. CC: @yuyichao @tkelman, Julia experts.
The problem is magnified when one vectorizes
f
.The text was updated successfully, but these errors were encountered: