Reduce invalidations when loading JuliaData packages#47889
Merged
Conversation
timholy
commented
Dec 13, 2022
| function hex2bytes end | ||
|
|
||
| hex2bytes(s) = hex2bytes!(Vector{UInt8}(undef, length(s) >> 1), s) | ||
| hex2bytes(s) = hex2bytes!(Vector{UInt8}(undef, length(s)::Int >> 1), s) |
Member
Author
There was a problem hiding this comment.
Possibly controversial. However, JuliaHub does not list an InfiniteStrings package (there is an InifiniteArrays package).
quinnj
reviewed
Dec 13, 2022
quinnj
approved these changes
Dec 13, 2022
timholy
commented
Dec 13, 2022
KristofferC
approved these changes
Dec 14, 2022
This was referenced Dec 14, 2022
aviatesk
approved these changes
Dec 14, 2022
a0553a9 to
90ea0b5
Compare
aviatesk
approved these changes
Dec 14, 2022
Member
|
The doctest failure seems to come from changes in this PR? |
Member
Author
|
Hmm, passes for me locally. |
Member
Author
Member
They're failing only on the new AWS runners, I'm not sure those are good doctests if results can be slightly different on different CPUs |
KristofferC
pushed a commit
that referenced
this pull request
Dec 16, 2022
(cherry picked from commit e84634e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes some invalidations that hinder both CSV (@quinnj) and DataFrames (@bkamins and @nalimilan). Both packages were benchmarked in the discussion of #47184 and @giordano noted that DataFrames had a large load-time regression.
This PR, on top of #47184, together with JuliaLang/Pkg.jl#3275 delivers an unqualified gain in the upcoming Julia 1.9 (workloads are defined in detail farther below):
using CSVCSV.File(...)using DataFrames...The substantial load-time penalty on "1.9" with just #47184 is explained by the fact that
Base.requireis among the invalidated targets, and therefore has to be recompiled while DataFrames is being loaded. This PR fixes that.Here are the workloads:
using CSV:@time using CSVCSV.File(...):@time @eval CSV.File(joinpath(pkgdir(CSV), "test", "testfiles", "precompile.csv"))using DataFrames...:@time begin using PooledArrays: PooledArrays, PooledArray; using DataFrames, Statistics; endDataFrames TTFX: uses the precompile workload.
CC @vchuravy, @vtjnash
@bkamins, one thing I also noted is that loading both DataFrames and CSV (either before or after, order shouldn't matter) invalidates some of the code in DataFrames. Happy to consult with you about fixing it if you need help.
precompile_blockersseems useful in this context, as it led me directly to some DataFrames code that wasn't very inferrable.