-
-
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
3x slow down in string benchmarks due to Fix annotated join with non-concrete eltype iters (#54919) #55279
Comments
Thanks for investigating this @Zentrik. Regarding the eyebrow-raising regressions you highlighted ( # 1.10
julia> using Chairmarks
julia> buffer = IOBuffer("A" ^ 50000)
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=50000, maxsize=Inf, ptr=1, mark=-1)
julia> @b readuntil(seekstart($buffer), "AA")
13.762 ns (1 allocs: 64 bytes)
# Nightly
julia> @b readuntil(seekstart($buffer), "AA")
92.853 ns (4 allocs: 208 bytes) From a quick look though, it's hard for me to see how the commit you linked (changing some of the I'll dig further into this, but if anybody else would like to take a look at this, that would be appreciated. |
Lines 357 to 371 in 197295c
Probably not relevant for performance, but it'd be nice to deduplicate the code here, e.g., |
Mmm, the to me the crux of it is that the logic I added in the code you link @nsajko should be fully resolved using compile-time information, except in the case of type-unstable iterators. It may be the case that buffer = IOBuffer("A" ^ 50000) # setup
readuntil(seekstart($buffer), "AA") # readuntil 2 benchmark |
The easiest might be to just revert locally and check if it fixes things. In that case, you just get the correct answer, no matter if it is hard to see or not. |
Since they are both short circuiting, neither is preferred, and so it isn't something that 'should' be changed (absent other considerations such as profiling) |
I tracked down the performance regression in It also doesn't fully fix the issue here since # master with #54070 reverted
julia> @b readuntil(seekstart($buffer), "AA")
44.819 ns (3 allocs: 192 bytes)
# 1.10
julia> @b readuntil(seekstart($buffer), "AA")
23.820 ns (1 allocs: 64 bytes) |
The remaining delta turns out to be because of an artifact of the benchmark definition itself: because the return value is a zero length string, the runtime could cheat and skip much of the work. However, the newly added |
The `clamp` function was defined in Base.Math, but required to be in Base now, so move it to intfuncs with other similar functions Fixes #55279
This is a more apt description, since it is not floating point related, and used earlier (such as in IOBuffer). Fixes JuliaLang#55279
The
["string", "readuntil", "target length 1"]
and["string", "readuntil", "target length 2"]
benchmarks got 3x slower recently. I bisected to 462d7f4, @tecosaur.See https://github.com/JuliaCI/NanosoldierReports/blob/master/benchmark/by_date/2024-07/26/report.md or https://tealquaternion.camdvr.org/compare.html?start=6b08e80bd1217c5c2eb6c89604c21faa5b2a156f&end=42a8efff5a6b96394a36af541cf8a7a4725632fb&stat=min-wall-time&name=string for the benchmark results
The text was updated successfully, but these errors were encountered: