-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Julia 1.3 runs my script at least 10x slower than Julia 1.1 does on my computer #33014
Comments
I can reproduce this and it's also slow on release-1.2. If was fast on ce17e05 which is 787 commits before release-1.2 so it happened somewhere in there if someone wants to bisect. |
@StefanKarpinski, thanks for looking at this. For me the performance of Julia 1.2.0 is comparable to 1.3-DEV.164, i.e. as fast as 1.1.1 and maybe a little faster. |
To repeat a probable MWE from the discourse post: sumsqdig(n::Int) = sum(i*i for i in digits(n)) julia> VERSION
v"1.3.0-alpha.156"
julia> @btime sumsqdig(5000_000)
661.931 ns (4 allocations: 192 bytes) julia> VERSION
v"1.1.0"
julia> @btime sumsqdig(5000_000)
91.624 ns (3 allocations: 176 bytes) If this is due to the code in A good fix would remove the allocation from |
Somewhere between Julia 1.3.1 & Julia 1.4.1 there's been a dramatic improvement in performance for this problem (on my laptop, at least). And, yes, it continues on through Julia 1.5.1 :). For myself, I would consider this particular issue closed. |
Please see the fuller discourse post.
Summary: On my computer, Julia 1.3 (from about DEV.308 through current) runs the posted script at least 10x slower than Julia 1.1.1 and even Julia 1.3-DEV through about DEV.164.
My best guess is that, in mid-May, there was a deliberate design decision to be less aggressive in the use of garbage collection. I can see how that would be useful on systems with much RAM, but on my laptop (1879MiB, per lshw) it's not helpful. Probably true for others with limited RAM, including embedded systems. If my guess is correct, would it be reasonable to have a command-line option so the user can tune gc aggressiveness, somewhat like the existing
--optimize
option?I've attached the script in question as a text file:
peuler92.jl.txt
The text was updated successfully, but these errors were encountered: