Skip to content

Take several regions in one ramdump - #125

Merged
mvassilev merged 1 commit into
developfrom
ramdump-several-regions
Nov 5, 2026
Merged

mvassilev merged 1 commit into
developfrom
ramdump-several-regions

Conversation

@mvassilev

Copy link
Copy Markdown
Collaborator

ramdump took one region, so a list of regions meant a process each: on chr20, 100
regions of 1 kb took 65 ms a region, about 40 ms of it ROOT's libraries starting and
28 ms opening the file, against 6.3 ms a region in a process that keeps the file open.

ramdump file region... now reads the regions in turn from the file kept open, each
region's records in order, as samtools view does without -M, so a record in two regions
is printed twice. -c prints the count of all of them. The readers made at the first
record found serve every region after it.

NA12878 chr20 at 30x on a Xeon E5-2690 v4, pinned to one socket, file in the page cache,
medians of 5 runs in alternating order, the 100 regions of the paper's access/loci.txt:

wall CPU memory
develop, a process each 6.55 s 6.55 s 45 MB
this, one process 0.73 s 0.75 s 51 MB

The output is the same, byte for byte. A new test checks the order and the counts with and
without a FLAG filter. All tests pass. No format change.

ramdump took one region, so a list of regions cost a process each, most
of it ROOT's libraries starting and the file being opened. It now reads
several regions in turn from the file kept open, each region's records
in order, as samtools view does without -M; -c counts them all.

On chr20 of NA12878, 100 regions of 1 kb take 0.73 s in one process
instead of 6.55 s in a process each.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread tools/ramdump.cxx
// Counting with no FLAG filter never has to decode a record.
if (countOnly && requireFlags == 0 && excludeFlags == 0) {
writer.Int(ramntuplescan(*ram, region.c_str(), nullptr));
Long64_t total = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: no header providing "Long64_t" is directly included [misc-include-cleaner]

tools/ramdump.cxx:18:

- #include <algorithm>
+ #include <RtypesCore.h>
+ #include <algorithm>

@mvassilev
mvassilev merged commit 92f3a3c into develop Nov 5, 2026
4 checks passed
@mvassilev
mvassilev deleted the ramdump-several-regions branch November 5, 2026 11:57
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.99%. Comparing base (e62acde) to head (cda4a45).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
tools/ramdump.cxx 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #125      +/-   ##
===========================================
+ Coverage    88.90%   88.99%   +0.08%     
===========================================
  Files           26       26              
  Lines         3506     3515       +9     
  Branches      1198     1203       +5     
===========================================
+ Hits          3117     3128      +11     
  Misses         204      204              
+ Partials       185      183       -2     
Flag Coverage Δ
unittests 88.99% <93.75%> (+0.08%) ⬆️

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

Files with missing lines Coverage Δ
test/ramdump_test.cxx 98.43% <100.00%> (+0.01%) ⬆️
tools/ramdump.cxx 86.44% <93.33%> (+0.95%) ⬆️
Files with missing lines Coverage Δ
test/ramdump_test.cxx 98.43% <100.00%> (+0.01%) ⬆️
tools/ramdump.cxx 86.44% <93.33%> (+0.95%) ⬆️
🚀 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