Faster alternative to hadd

Dear all!

I need to merge root files that have a lot of histograms and
directories. hadd was too slow for me so I put together an alternative
under the name of fhadd (fast hadd). It trades of speed vs memory
otherwise it behaves quite like the regular hadd.

If you are interested you can give it a try. You can find it here:

/afs/cern.ch/user/s/schmitts/public/fhadd/fhadd.py

A quick comparison to hadd can be started like this:

ssh lxplus.cern.ch
source /afs/cern.ch/user/s/schmitts/public/fhadd/test.sh

fhadd is faster by a factor 4. It heavily depends on the structure of
the input file but I haven’t found fhadd to be slower than hadd in any case.

Best regards,

Sebastian

1 Like