Skip to content

Read the numeric fields of records in bulk - #123

Merged
mvassilev merged 1 commit into
developfrom
bulk-numeric-fields
Nov 5, 2026
Merged

mvassilev merged 1 commit into
developfrom
bulk-numeric-fields

Conversation

@mvassilev

Copy link
Copy Markdown
Collaborator

ramdump's RecordReader read every field of a record through an RNTupleView, one call
per value. In a perf profile of a full read of chr20 (29.7 s of CPU), RFieldBase::Read
took 7.5% and most of the 8.3% of the per-row callback.

The fifteen numeric fields (FLAG, reference, position, MAPQ, mate reference, the mate
deltas, NM, AS, XS, MQ, RG, PG, the tag order and the compression flags) are now read with
RNTupleView::CreateBulk() into vectors, a run of rows of one cluster at a time; for these
simple fields a bulk read copies whole pages. A run starts at 1,024 rows and doubles up to
65,536 while the rows come in order, so a small region reads as many pages as before. The
strings and vectors are read as before.

NA12878 chr20 at 30x (17.7 million records) on a Xeon E5-2690 v4, pinned to one socket,
files in the page cache, medians of 5 runs in alternating order, against #119:

before after
full read (-h) 18.09 s, 28.6 s CPU 16.76 s, 27.2 s CPU
dump of 10 Mb 3.42 s, 66 MB 3.19 s, 61 MB
dump of 1 kb 0.06 s, 39 MB 0.06 s, 38 MB

The output is the same, byte for byte, for every step and for regions and flag filters on
2 million records of chromosome 11. All tests pass. No format change.

ramdump read every field of a record through an RNTupleView, one call
per value; in a profile of a full read, RFieldBase::Read alone took
7.5% of the CPU time. The fifteen numeric fields are now read with bulk
reads into vectors, a run of rows of a cluster at a time, starting at
1,024 rows and doubling to 65,536 while the rows come in order, so a
small region reads as many pages as before.

On chr20 of NA12878 a full read takes 16.8 s instead of 18.1 s.
@mvassilev
mvassilev merged commit 29428e1 into develop Nov 5, 2026
4 checks passed
@mvassilev
mvassilev deleted the bulk-numeric-fields branch November 5, 2026 08:51
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

clang-tidy review says "All clean, LGTM! 👍"

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.02%. Comparing base (c85de0b) to head (c2a9c7c).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
tools/ramdump.cxx 94.66% 0 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #123      +/-   ##
===========================================
+ Coverage    89.00%   89.02%   +0.02%     
===========================================
  Files           26       26              
  Lines         3364     3408      +44     
  Branches      1127     1155      +28     
===========================================
+ Hits          2994     3034      +40     
  Misses         196      196              
- Partials       174      178       +4     
Flag Coverage Δ
unittests 89.02% <94.66%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tools/ramdump.cxx 86.13% <94.66%> (+1.08%) ⬆️
Files with missing lines Coverage Δ
tools/ramdump.cxx 86.13% <94.66%> (+1.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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