Skip to content

DPL Analysis: bind partitions without walking every task member - #16049

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16049
Open

ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16049

Conversation

@ktf

@ktf ktf commented Nov 4, 2026

Copy link
Copy Markdown
Member

invokeProcess walked all members of the task seven times per process
function to bind partitions and grouped combinations, instantiating the
binding lambdas for every member, although only those two kinds act on
them; for everything else the calls are empty overloads. Select the
partitions and combination generators once per task type, with a named
selector so that the full member walk is shared by all process
functions, and run the binding lambdas over those only. The calls that
do something happen in the same order as before.

StructToTuple gains apply_refs_tuple_cat_sized, a member walk whose
callable returns a tuple per member, concatenated into one.

Full -O2 compile, Apple clang 21, before -> after:

  • femtoUniverseProducerTask: 66.5 s -> 58.4 s (macro path, as for
    GCC 14), 67.6 s -> 58.7 s (structured binding packs)
  • dataCreatorCharmResoToDstarReduced: 44.6 s -> 41.7 s
  • derivedDataWriter: 79.9 s -> 74.8 s
    In femtoUniverseProducerTask the instantiation of the member walks goes
    from 5.9 s to 1.4 s.

invokeProcess walked all members of the task seven times per process
function to bind partitions and grouped combinations, instantiating the
binding lambdas for every member, although only those two kinds act on
them; for everything else the calls are empty overloads. Select the
partitions and combination generators once per task type, with a named
selector so that the full member walk is shared by all process
functions, and run the binding lambdas over those only. The calls that
do something happen in the same order as before.

StructToTuple gains apply_refs_tuple_cat_sized, a member walk whose
callable returns a tuple per member, concatenated into one.

Full -O2 compile, Apple clang 21, before -> after:
- femtoUniverseProducerTask: 66.5 s -> 58.4 s (macro path, as for
  GCC 14), 67.6 s -> 58.7 s (structured binding packs)
- dataCreatorCharmResoToDstarReduced: 44.6 s -> 41.7 s
- derivedDataWriter: 79.9 s -> 74.8 s
In femtoUniverseProducerTask the instantiation of the member walks goes
from 5.9 s to 1.4 s.
@ktf
ktf requested a review from a team as a code owner November 4, 2026 19:17
@ktf

ktf commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

@aalkin apparently selecting the bindables upfront avoids instanciating the large types at each invokation (for some 5% speedup while building O2Physics).

@aalkin

aalkin commented Nov 5, 2026

Copy link
Copy Markdown
Member

This is similar to what we have seen with the other pack operations, since it is always combinatorics. For iterating on the preselected tasks members and methods we need C++26 to properly fix this.

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

Development

Successfully merging this pull request may close these issues.

2 participants