Using weakdeps to reduce load time on Julia v1.9#270
Using weakdeps to reduce load time on Julia v1.9#270oschulz wants to merge 2 commits intoJuliaArrays:masterfrom
Conversation
9eeb22b to
fc5d289
Compare
|
Looks like the test failures on nightly are due to changed output formatting in doctests. |
|
I'm totally indifferent to this, because these packages are lightweight "*Core" interface packages anyway. And I'm not a member of this repo anyway :) |
I think for now it needs to be StaticArraysCore, because StructArrays will still depend on it with pre-v1.9 Julia. |
|
I'm not a member either |
|
Makes sense, but maybe it'd be good for @N5N3 to look at this because of the overlap with #265. If I understand correctly, the issue is that depending on StaticArrays proper (rather than StaticArraysCore) allows for a more efficient implementation of broadcasting. In that case, maybe the simplest is to wait that 1.9 comes out and then use a weak dependency on StaticArrays? Intuitively, I would think that the extra load time on older julia versions is a lesser issue that either worse performance or increased code complexity. |
Oh, right, then we should go for StaticArrays proper as in #265 . |
|
Shall I take StaticArrays out of this PR then, and only do Tables and GPUArraysCore in here? |
|
LGTM. I think we can merge this without change. (#265 needs rebasing anyway as IIUC we have decided not to use |
|
Thanks for the input, then I imagine it can be merged as is (moving all functionality to extensions). Any ideas why CI is failing? |
|
IIRC, NamedTuple has been better printed on master. All failures are doctest error. |
|
I see, but what about the invalidation action? It seems as though it is struggling with Pkg operations. |
|
Looks like an upstream issue JuliaLang/Pkg.jl#3327 |
|
So can we merge this? |
|
Bump @piever |
|
The PR itself LGTM. I'm a bit uncomfortable that using weak dependencies breaks the invalidation CI, but it doesn't look like there's a way around this. I'm planning to merge and tag in the next few days (there are a few PRs about to be merged that can probably go in the same release). |
|
Thanks @piever ! |
| @@ -38,3 +43,5 @@ for (f, g) in zip((:append!, :prepend!), (:push!, :pushfirst!)) | |||
| end | |||
There was a problem hiding this comment.
When put into extension, these functions are kinda-piracy: loading Tables changes a completely independent method, eg Base.push!(::StructVector, ::Any).
There was a problem hiding this comment.
Maybe they aren't needed at all? Not sure.
There was a problem hiding this comment.
Hm, that's a very good point, we really shouldn't do that. That code may be necessary - we may have to keep Tables as a hard dependency. But maybe Tables itself could be made more lightweight using Pkg extensions or so?
There was a problem hiding this comment.
Ah, that's a very good point, I hadn't thought about that. Yes, we do need Tables for basic functionality like pushing or appending to a StructVector effectively, so that should definitely stay a hard dependency. Still, it is supposed to be an interface package, so that should be OK.
|
Can this get merged without Tables part, keeping Tables intergration as is? |
I think so - should I just take the Tables part out? |
|
Sorry for the slow reply! Yes, this but without the Tables.jl part can be merged. |
|
Sorry, I lost track of this PR, I'll take Tables out. |
No worries! In the end, the relevant part of this PR has been incorporated in #265 so they'll end up merged together, I imagine this one here can be closed. |
|
Good point. let's just move on with #265, less merge conflicts then. |
Before (StructArrays v0.6.15):
This PR: