Skip to content

Commit 71d00e6

Browse files
Move Tables.jl and IteratorInterfaceExtensions.jl to extension
This change moves the Tables.jl integration functionality to a package extension to reduce precompilation time by avoiding loading heavy table-related dependencies when they are not needed. Changes: - Move Tables.jl and IteratorInterfaceExtensions.jl from deps to weakdeps - Create RecursiveArrayToolsTablesExt extension with all table traits - Remove tabletraits.jl from main module - Reduce compilation time from ~309ms to ~245ms (~20% improvement) The Tables interface remains fully functional when Tables.jl is loaded, but no longer impacts basic RecursiveArrayTools usage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 204f2ab commit 71d00e6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
88
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
99
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1010
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
11-
IteratorInterfaceExtensions = "82899510-4779-5014-852e-03e436cf321d"
1211
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1312
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1413
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
1514
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1615
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
17-
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1816

1917
[weakdeps]
2018
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
2119
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
20+
IteratorInterfaceExtensions = "82899510-4779-5014-852e-03e436cf321d"
2221
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
2322
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
2423
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
2524
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
2625
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2726
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
27+
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
2828
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
2929
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3030

@@ -37,6 +37,7 @@ RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements"
3737
RecursiveArrayToolsReverseDiffExt = ["ReverseDiff", "Zygote"]
3838
RecursiveArrayToolsSparseArraysExt = ["SparseArrays"]
3939
RecursiveArrayToolsStructArraysExt = "StructArrays"
40+
RecursiveArrayToolsTablesExt = ["Tables", "IteratorInterfaceExtensions"]
4041
RecursiveArrayToolsTrackerExt = "Tracker"
4142
RecursiveArrayToolsZygoteExt = "Zygote"
4243

src/tabletraits.jl renamed to ext/RecursiveArrayToolsTablesExt.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
module RecursiveArrayToolsTablesExt
2+
3+
import RecursiveArrayTools: AbstractDiffEqArray, variable_symbols
4+
import Tables
5+
import IteratorInterfaceExtensions
6+
17
# Tables traits for AbstractDiffEqArray
28
Tables.istable(::Type{<:AbstractDiffEqArray}) = true
39
Tables.rowaccess(::Type{<:AbstractDiffEqArray}) = true
@@ -80,3 +86,5 @@ IteratorInterfaceExtensions.isiterable(::AbstractDiffEqArray) = true
8086
function IteratorInterfaceExtensions.getiterator(A::AbstractDiffEqArray)
8187
Tables.datavaluerows(Tables.rows(A))
8288
end
89+
90+
end

src/RecursiveArrayTools.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ using SymbolicIndexingInterface
1111

1212
import Adapt
1313

14-
import Tables, IteratorInterfaceExtensions
15-
1614
"""
1715
AbstractVectorOfArray{T, N, A}
1816
@@ -124,7 +122,6 @@ abstract type AbstractDiffEqArray{T, N, A} <: AbstractVectorOfArray{T, N, A} end
124122

125123
include("utils.jl")
126124
include("vector_of_array.jl")
127-
include("tabletraits.jl")
128125
include("array_partition.jl")
129126
include("named_array_partition.jl")
130127

0 commit comments

Comments
 (0)