-
Notifications
You must be signed in to change notification settings - Fork 62
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 hash(::Perm) in Julia 0.7 #245
Comments
The allocations are fixed in #248, but the runtime regression persists. I am currently building latest julia to see if the regression is fixed there. |
indeed: julia> using AbstractAlgebra
[ Info: Recompiling stale cache file /home/kalmar/.julia/compiled/v1.1/AbstractAlgebra/b8V2b.ji for AbstractAlgebra [c3fe647b-3220-5bb0-a1ea-a7954cac585d]
julia> function test(n)
res = UInt(0)
for p in Generic.elements!(PermGroup(n))
res = hash(p, res)
end
return res
end
test (generic function with 1 method)
julia> @time test(5)
0.147882 seconds (242.94 k allocations: 11.902 MiB, 5.39% gc time)
0x3a8569f5ec15165c
julia> @time test(5)
0.000026 seconds (10 allocations: 528 bytes)
0x3a8569f5ec15165c
julia> @time test(6)
0.000150 seconds (10 allocations: 528 bytes)
0x1b1548da152f74a8
julia> @time test(10)
0.961476 seconds (10 allocations: 592 bytes)
0x009115240712e5c5
julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS = 2 thanks for looking into this; I opened it more for a reminder for myself, but i'm rather busy with other stuff |
It is not fixed on julia> versioninfo()
Julia Version 1.2.0-DEV.221
Commit 8fa0645ef1 (2019-01-28 01:13 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake) |
So almost all the time spent in the loop seems to come from I'm changing the title of the issue accordingly, feel free to revert if you disagree. |
It is very scary that |
yeah, with the new version of hash we have julia> @time test(10)
0.276211 seconds (5 allocations: 416 bytes)
0x8fef8d8d2a72885b
old hash: julia> @time test(10)
1.016941 seconds (5 allocations: 416 bytes)
0x009115240712e5c5
many thanks @rfourquet, I forgot about this issue! |
this was probably introduced during transition to julia-0.7:
The text was updated successfully, but these errors were encountered: