Skip to content

Make StructArray dataids inferrable for many columns - #375

Open
aplavin wants to merge 1 commit into
JuliaArrays:masterfrom
aplavin:wide-dataids
Open

aplavin wants to merge 1 commit into
JuliaArrays:masterfrom
aplavin:wide-dataids

Conversation

@aplavin

@aplavin aplavin commented Nov 12, 2026

Copy link
Copy Markdown
Member

Performance win, MWE:

using StructArrays
row = NamedTuple{ntuple(i -> Symbol(:c, i), 33)}(ntuple(_ -> 0.0, 33))
sw  = StructArray(fill(row, 10))   # 33 columns, 10 rows
v   = fill(row, 10)                # plain Vector of the same rows

f!(sw, v) = (sw .= v; nothing)
f!(sw, v)
@allocated f!(sw, v)
# origin/master:  15424
# wide-dataids:   0

mapreduce over components stopped inferring and started allocating above 32 columns.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant