You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently podio-merge-files reads every Frame and writes it back. This is very slow (between 10x and 100x) compared to using hadd; I would say unusable. For TTrees and RNTuples, our files can be merged with hadd, producing readable files with the only caveat that there are some categories that may be repeated a few times, like metadata. The new implementation is equivalent to what we had before, but much faster.
BEGINRELEASENOTES
Use TFileMerger with ROOT files in podio-merge-files to speed it up and add code to make sure the metadata is set correctly. Keep the old behaviour for the other backends (SIO only).
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (minor comments below). I suppose we are not yet at a stage where we have less code if we use the root file merger (that hadd uses internally) directly instead of going through hadd and then "fixing things" afterwards?
Looks good to me (minor comments below). I suppose we are not yet at a stage where we have less code if we use the root file merger (that hadd uses internally) directly instead of going through hadd and then "fixing things" afterwards?
In the end I tried both with two passes of hadd and using TFileMerger; for merging files during several minutes it takes the same time. I'll leave the implementation with TFileMerger that doesn't have to run subprocesses. And it is quite close in time to running hadd directly, plus some constant overhead due to opening files, python and creating the metadata. I ran with thousands of files from EOS, RNTuples and it seems to work fine (and as quickly as hadd). hadd is also quite fast because it uses a low compression, which I have enabled as a default here but it is configurable. This should be strictly an improvement over what was there before.
Please @meleneemil, have a try again, it will appear in the nightlies tomorrow.
jmcarcell
changed the title
Use hadd with podio-merge-files
Use TFileMerger to speed up podio-merge-filesJul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently
podio-merge-filesreads every Frame and writes it back. This is very slow (between 10x and 100x) compared to usinghadd; I would say unusable. For TTrees and RNTuples, our files can be merged withhadd, producing readable files with the only caveat that there are some categories that may be repeated a few times, like metadata. The new implementation is equivalent to what we had before, but much faster.BEGINRELEASENOTES
TFileMergerwith ROOT files inpodio-merge-filesto speed it up and add code to make sure the metadata is set correctly. Keep the old behaviour for the other backends (SIO only).ENDRELEASENOTES
@meleneemil