Skip to content

[ntuple] Memory optimization for the descriptor - #23400

Merged
jblomer merged 8 commits into
root-project:masterfrom
jblomer:ntuple-memopt
Sep 21, 2026
Merged

jblomer merged 8 commits into
root-project:masterfrom
jblomer:ntuple-memopt

Conversation

@jblomer

@jblomer jblomer commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Several optimizations to reduce the memory footprint and the number of memory copies of the schema part of the descriptor. Most notably introduces string interning for the field descriptor strings.

Comment thread tree/ntuple/inc/ROOT/RNTupleDescriptor.hxx Outdated
Comment thread tree/ntuple/src/RNTupleUtils.cxx
Comment thread tree/ntuple/src/RNTupleUtils.cxx Outdated
Comment thread tree/ntuple/inc/ROOT/RNTupleDescriptor.hxx
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 16h 57m 15s ⏱️
 3 875 tests  3 871 ✅ 0 💤 4 ❌
80 069 runs  80 061 ✅ 0 💤 8 ❌

For more details on these failures, see this check.

Results for commit a3d6a1b.

♻️ This comment has been updated with latest results.

@silverweed silverweed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. looks good to me, just a couple more comments

Comment thread tree/ntuple/src/RNTupleUtils.cxx
Comment thread tree/ntuple/src/RNTupleDescriptor.cxx
Reduce size of the struct from 72 to 56 bytes (in most cases, unless the
column has a value range)
This factory method is an unnecessary complication. Field descriptors
are now directly added from RFieldBase objects through a new
RNTupleDescriptorBuilder::AddField() overload.
Member reordering reduced the size from 248B to 240B.
...instead of cloning it. Avoids the memory copies.
...instead of cloning it. Avoids the memory copies.
An internal utility class that maintains a sorted list of immutable
strings.
Let the field descriptors strings be stored in the string pool of the
surrounding RNTupleDescriptor. Deduplicates the type names and field
names. Also reduces the size of the RFieldDescriptor struct from 240B to
152B.

@silverweed silverweed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jblomer
jblomer merged commit 47a4813 into root-project:master Sep 21, 2026
32 of 35 checks passed
@jblomer
jblomer deleted the ntuple-memopt branch September 21, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants