Skip to content

[PWGCF/Femto] ~35% faster track-track mixing: hoist the per-window track slice#16663

Open
ktf wants to merge 1 commit into
AliceO2Group:masterfrom
ktf:pr16663
Open

[PWGCF/Femto] ~35% faster track-track mixing: hoist the per-window track slice#16663
ktf wants to merge 1 commit into
AliceO2Group:masterfrom
ktf:pr16663

Conversation

@ktf

@ktf ktf commented Jun 15, 2026

Copy link
Copy Markdown
Member

In processMixedEvent the partner partitions are sliced per
(collision1, collision2) pair, but collision1 is fixed across its entire
mixing window. sliceByCached only caches the offset/count — it re-runs
arrow::Table::Slice on every call (a per-column ArrayData allocation +
shared_ptr refcount storm) — so at mixing depth D, collision1's track
slice was rebuilt D times per window for no reason.

Hoist sliceParticle1 into a std::optional declared before the
combinations loop and (re)materialize it only when collision1.globalIndex()
changes, i.e. once per window. collision2 genuinely varies per pair and is
left untouched.

@github-actions

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions Bot changed the title Hoist sliceParticle1 from the inner loop [PWGCF] Hoist sliceParticle1 from the inner loop Jun 15, 2026
@ktf

ktf commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@aalkin this is one of the hotspots for the slicing we were discussing today. This actually avoids half of the cost by moving the construction outside.

@ktf ktf changed the title [PWGCF] Hoist sliceParticle1 from the inner loop [PWGCF/Femto] ~35% faster track-track mixing: hoist the per-window track slice Jun 15, 2026
@ktf

ktf commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

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

Labels

Development

Successfully merging this pull request may close these issues.

1 participant