-
-
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 v1.11.1 regression: open(::Cmd)
is 4X slower than v1.10.4
#56352
Comments
This comment has been minimized.
This comment has been minimized.
Do you know what caused the slow down? I notice your read implementations don't acquire the required locks that the other functions use, so they are somewhat dangerous to call those functions (unlike the default implementations), though most typical uses are probably quite fine as the locks may be often unnecessary for single threaded use |
I did not look into the detail implement ation of readline in Julia v1.11 because it calls a C function. Unfortunately, I am not a C person and cannot tell what lead to the regression. Actually, when I found readline of On the other hand, I am quite impressed that my code runs faster in v1.11, so the new version definitely has performance improvement on very low level codes. Probably it is not a very huge bug, just some extra copy? |
Ref #50615 |
Looks like there is a readuntil optimization in base/stream for this, which missed getting renamed to copyuntil in #48273 |
Fixes #56352, with the repro in that issue: ``` Master: 1.114874 seconds (13.01 M allocations: 539.592 MiB, 3.80% gc time) After: 0.369492 seconds (12.99 M allocations: 485.031 MiB, 10.73% gc time) 1.10: 0.341114 seconds (8.36 M allocations: 454.242 MiB, 2.69% gc time) ```
Fixes #56352, with the repro in that issue: ``` Master: 1.114874 seconds (13.01 M allocations: 539.592 MiB, 3.80% gc time) After: 0.369492 seconds (12.99 M allocations: 485.031 MiB, 10.73% gc time) 1.10: 0.341114 seconds (8.36 M allocations: 454.242 MiB, 2.69% gc time) ``` (cherry picked from commit 07530bc)
Hi,
I found
Base.Process
created byopen(x::Cmd)
is extremely slower than v1.10.4.Minimal example in Linux:
First create a large file:
Then, run the following command in Julia v1.11.1 and v1.10.4:
Here is the differences:
2.123290 seconds (12.57 M allocations: 496.226 MiB, 5.34% gc time, 2.38% compilation time)
0.579683 seconds (8.07 M allocations: 440.373 MiB, 3.59% gc time, 3.00% compilation time)
I also wrote a package to solve the regression, which is BiBufferedStreams.jl
Its readme has a thorough benchmark, eliminating the effects of precompilation.
The text was updated successfully, but these errors were encountered: