Skip to content

[RF] Serialize RooWorkspace snapshots in a more compressed way #19380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guitargeek
Copy link
Contributor

This commit eliminates the huge overhead when storing parameter snapshots in a RooWorkspace.

A "snapshot" actually needs to contain very little info. What's happening right now is that for storing a Snapshot, RooFit creates a RooRealVar clone for each variable, which is
sizeof(RooRealVar) = 1000 bytes plus manually-allocated overhead (e.g. for binning info).

This memory overhead can be eliminated in the custom RooWorkspace::Streamer, only storing the information necessary for a snapshot. And when reading back the file, the RooRealVar clones will be instantiated so there is not change in behavior for the user.

Closes #18032.

@guitargeek guitargeek self-assigned this Jul 15, 2025
@guitargeek guitargeek requested a review from lmoneta as a code owner July 15, 2025 14:00
@guitargeek guitargeek changed the title [RF] Serialize RooWorkspace snapshots is a better way [RF] Serialize RooWorkspace snapshots in a more compressed way Jul 15, 2025
This commit eliminates the *huge* overhead when storing parameter
snapshots in a RooWorkspace.

A "snapshot" actually needs to contain very little info. What's
happening right now is that for storing a Snapshot, RooFit creates a
`RooRealVar` clone for each variable, which is
`sizeof(RooRealVar) = 1000` bytes plus manually-allocated overhead (e.g.
for binning info).

This memory overhead can be eliminated in the custom
`RooWorkspace::Streamer`, only storing the information necessary for a
snapshot. And when reading back the file, the `RooRealVar` clones will
be instantiated so there is not change in behavior for the user.

Closes root-project#18032.
Copy link

Test Results

    21 files      21 suites   3d 10h 42m 1s ⏱️
 3 211 tests  3 211 ✅ 0 💤 0 ❌
65 699 runs  65 699 ✅ 0 💤 0 ❌

Results for commit 42cf411.

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.

[RF] Creating snapshots blows up the size of RooWorkspace to easily reach 1GB buffer limit
1 participant