-
-
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
@test is extremely slow in 0.5 for BusinessDays.jl #18361
Comments
This seems to be purely due to the overhead of compiling the large block. Even when moving the block of code inside the loop into a function, the first execution of the function takes a long time. FWIW, a |
I have done a simpler testcase, that does not use any additional packages: https://gist.github.com/aviks/d5152303cbf23eef6f69bc8a5919151d This is a function with around 500 lines in it. Each line is a julia> include("/Users/aviks/test_18361.jl")
Started loading. All times relative to now
Finished loading function 0 milliseconds
Compiled, started execution 1000 milliseconds
Finished Execution 3000 milliseconds On 0.5, its about 500 times worse. julia> include("/Users/aviks/test_18361.jl")
Started loading. All times relative to now
Finished loading function 1987 milliseconds
Compiled, started execution 487572 milliseconds
Finished Execution 487591 milliseconds I tried this with a 1000 line function, and went for a walk. My laptop went to sleep before the code completed. |
what about with BaseTestNext on 0.4, or with Julia 0.5 but using LLVM 3.3? how much of this is compiler regression and how much is changed implementation of |
In a similar case I've seen ~60% time in the parser/lowering 40% in type inference. |
that's a duplicate of #15346. although, you also might want to |
I believe this is due to compile time. If I remove the function definition, and put 500 Going back to the original function definition, there is clearly some exponential growth in compile time, as function of the number of lines of code inside the function Given this, is this the same as #15346 ? |
There's even the insane example in #16122, which is still with us (and perhaps even worse than before). |
On @tkelman's compiler regression vs If I use
This result is way faster than Avik's, and shows that On 0.4, it's even faster: (same result from Avik's test)
|
The problem with many tests is most likely #18077, which is caused by our inlining a large number of try-catch blocks, and the performance of inference in that case. |
The big hit in this case seems to be
|
Yes, the implementation of |
Ok. Let me put it this way: given the change in |
Closing as a dup of #18077. I suspect this issue will surface in other packages too. |
I put up a gist at https://gist.github.com/felipenoris/3dbd7ff6a830be372e45dc337bb204cf with the slow code.
Once julia reaches line 19:
it takes a long time to start executing what´s inside the
for
loop.If I just unroll the loop (see https://gist.github.com/felipenoris/d9ba8d9ee5b116d259a6de3189418055), it runs smoothly, just like 0.4 does.
JuliaFinance/BusinessDays.jl#4
#18276
The text was updated successfully, but these errors were encountered: