-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
methodswith
10x slower since v1.0
#43468
Comments
You seam to have a very fast computer. This is what I see:
|
32 seconds seems pathological, I get just under 5 on a similar machine: julia> @time methodswith(X)
4.821725 seconds (23.77 M allocations: 1.244 GiB, 2.47% gc time, 89.88% compilation time)
julia> versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake) |
It's a 6-yo laptop, intel dual core i5, so not that fast :) but your |
Thanks to @jakobnissen the regression for the first call is down to about 2x on my computer which I think is acceptable given that there are many more methods to sift through. Shoutout to juliaup and @davidanthoff for making it incredibly easy for me to test out Julia 1.0:
The time for subsequent calls, though, still has a 10x regression. julia> struct X end
julia> @time methodswith(X);
# 1.0
0.367881 seconds (580.20 k allocations: 31.340 MiB, 1.89% gc time)
0.075684 seconds (75.90 k allocations: 5.041 MiB)
0.081371 seconds (75.90 k allocations: 5.041 MiB, 12.62% gc time)
0.075804 seconds (75.90 k allocations: 5.041 MiB)
# 1.9
0.849289 seconds (877.66 k allocations: 48.833 MiB, 1.54% gc time, 4.94% compilation time)
0.830985 seconds (844.64 k allocations: 46.564 MiB, 2.58% gc time)
0.771522 seconds (844.64 k allocations: 46.564 MiB, 0.88% gc time)
0.779156 seconds (844.64 k allocations: 46.564 MiB, 0.50% gc time) |
methodswith
10x worse since v1.0methodswith
10x slower since v1.0
it seems like the bottleneck is calling |
When implementing julia-vscode/julia-vscode#3240 . I find methodswith could be really slow (more than 10 seconds on a decent server) when using a lot of modules on simple common Dict types. Is it possible to fix the performance. Or add a methodswith argument |
@xgdgsc is that with Julia 1.9? It should be much faster on that version |
That was on 1.8. Test 1.9 it still uses similar time, although first time call after precompiling is much faster. I guess it 's because most code is already in C. Would adding the
if you use more than 30 modules. A reference Project.toml :
|
I see two ways to make it faster:
|
Presumably it would be possible with the correct data structures (e.g., an However, one option would be to define a method to create such a structure, which might be useful to speed up cases where you're making multiple |
I workaround this by using |
0.1 seconds now. Hope ok to close. |
Latency has been improved since #47302, but each call is still 10x slower than in 1.0, so I prefer this remains open |
@jakobnissen the example in the OP seems to be as fast on 1.10 as on 1.0, do you measure something else? |
I measure the same thing on the second run, after JIT compilation:
Julia 1.9.2:
|
Interestingly, I don't see the issue on mac (probably because it is using Rosetta for 1.0 on mac aarch64). But on Linux, I do observe a big difference. |
I do see this issue on macx@x ~ % julia +1.0 -q --startup-file=no
julia> VERSION
v"1.0.5"
julia> struct X end
julia> methodswith(X);
julia> @time methodswith(X);
0.043441 seconds (75.90 k allocations: 5.041 MiB)
julia>
x@x ~ % julia -q --startup-file=no
julia> VERSION
v"1.10.0-alpha1"
julia> struct X end
julia> methodswith(X);
julia> @time methodswith(X);
0.196974 seconds (319.68 k allocations: 14.455 MiB)
julia> versioninfo()
Julia Version 1.10.0-alpha1
Commit f8ad15f7b16 (2023-07-06 10:36 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M2
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores |
This is likely intended. The code was not very accurate in v1.0, and now it should be more complete at listing methods. |
After |
I don't think users should expect this to be instantaneous-interactive speed. The interactive version is |
Do we have a way to close this with an appropriate label in that case? |
Sure we can close this. The interactive version is in REPLCompletions, so doesn't seem like anything left to do. |
For future reference, the regression in |
The text was updated successfully, but these errors were encountered: