Skip to content

[RF][HS3] Significantly speed up JSON import of large models#22502

Merged
guitargeek merged 3 commits into
root-project:masterfrom
guitargeek:hs3_speedups
Jun 11, 2026
Merged

[RF][HS3] Significantly speed up JSON import of large models#22502
guitargeek merged 3 commits into
root-project:masterfrom
guitargeek:hs3_speedups

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

Significantly speed up model import from JSON, inspired by the reproducer from issue #22497.

This speeds up the workspace factory language if the same constructors
are used repeatedly, which is quite common when models are built
programmatically.
Fast-path importers for RooProduct, RooAddition, and RooProdPdf that
bypass the generic factory-expression mechanism, which is quite
expensive because it uses the interpreter. This dramatically speeds up
the import of models from JSON that use instances of these common
classes in large numbers.
Looking up by name in the JSON tree is quite slow and happens often
during model import from JSON. Caching the pointers to the JSON nodes
corresponding to the RooAbsArgs (distributions and functions) speeds up
JSON import significantly.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 17h 18m 3s ⏱️
 3 862 tests  3 813 ✅   0 💤 49 ❌
77 146 runs  76 946 ✅ 151 💤 49 ❌

For more details on these failures, see this check.

Results for commit 32cc22e.

♻️ This comment has been updated with latest results.

@lmoneta lmoneta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!
Thank you Jonas for this significant improvement!

@guitargeek guitargeek merged commit 149cca4 into root-project:master Jun 11, 2026
56 of 62 checks passed
@guitargeek guitargeek deleted the hs3_speedups branch June 11, 2026 13:16
@guitargeek

Copy link
Copy Markdown
Contributor Author

/backport to 6.40

@root-project-bot

Copy link
Copy Markdown

Preparing to backport PR #22502 to branch 6.40 requested by guitargeek

@root-project-bot

Copy link
Copy Markdown

This PR has been backported to branch 6.40: #22580

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.

3 participants