Skip to content

performance fixes for wide structarrays - #370

Open
aplavin wants to merge 8 commits into
masterfrom
perf_wide
Open

aplavin wants to merge 8 commits into
masterfrom
perf_wide

Conversation

@aplavin

@aplavin aplavin commented Nov 10, 2026

Copy link
Copy Markdown
Member

I recently encountered large performance issues with wide structarrays, and remembered a PR #358 from @KristofferC – it does fix some of those. Still, that PR doesn't fix everything, as it doesn't seem to apply the approach consistently.
Here is a PR that:

  • applies a single performance optimization consistently: it was already in get_ith function, here I just extract the core and apply broader; 1 generated function before this PR – and still 1 generated function after
  • not mixes multiple unrelated improvements, for ease of review
  • fixes both "Construct <...>" rows from the table in Fixes for low hanging performance "bugs" (AI driven) #358, and really all related cases I think
  • uses inference tests instead of adding separate manual benchmark scripts

Hopefully, should be quite straightforward :)

aplavin and others added 7 commits November 12, 2026 14:13
Covers 32 and 64 components, same and mixed types, Tuple and NamedTuple.
Operations not yet inferrable at these widths are marked broken.

Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
_mapcols is a generated componentwise map that stays inferrable for any
number of components, unlike Base.map on 32+ element tuples.

Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
Makes StructArray(cols) inferrable for 32+ components.

Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
similar, copy, reshape, deleteat!, keepat!, pop!, popfirst!, refarray,
replace_storage and colmetadata become inferrable for 32+ components.

Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
Comment thread src/structarray.jl Resolved

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.

2 participants