# Large changes in branch sizes in later builds of ROOT

**URL:** <https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753>\
**Category:** ROOT\
**Tags:** root\
**Created:** [March 13, 2026, 9:29am UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753 "2026-03-13T09:29:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eirik\_Gramstad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eirik_gramstad/32/27170_2.png) [@Eirik\_Gramstad](https://root-forum.cern.ch/u/Eirik_Gramstad)\
**Post date:** [March 13, 2026, 9:29am UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/1 "2026-03-13T09:29:47Z")

</div>

Dear ROOT experts,

I’ve been doing some size comparisons between two identical (in terms of content and number of events) set of ROOT NTuples, one made with ROOT v6.36.02 and another made with v6.39.01 (compiled from master on 20/11-2025). They’re both created from another set of NTuples, originally made with 6.36.02, using the RDataFrame::Snapshot function.

I see some quite large changes of the sizes of most branches, in particular for empty branches (of type Array\<float/int\>). In v6.39.01 the empty vectors take up 2.9596 bytes/ev while in v6.36 only 1.4461 bytes/ev. Moreover for the other branches, which are not empty, there seems to be a size increase between 15 - 50% in the NTuples made with v6.39.01. Overall, including all the 129 branches of my NTuple the v6.39 one is 23% larger than the one made with 6.36.

Are these changes expected in later ROOT versions or is it because I’m mixing different ROOT version in the NTuple workflow?

Each set of NTuple has a total of 1 143 602 162 events and the total size is 336 GB (6.39) and 273 GB (6.36)

best,

Eirik

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [March 13, 2026, 2:18pm UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/2 "2026-03-13T14:18:26Z")

</div>

Dear @Eirik_Gramstad ,

Thank you for reaching out to the forum!

No, such a large increase is not expected. Could you guide me towards reproducing this behaviour, maybe with a script that creates only one file and so I can compare with the different versions of ROOT?

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![Eirik\_Gramstad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eirik_gramstad/32/27170_2.png) [@Eirik\_Gramstad](https://root-forum.cern.ch/u/Eirik_Gramstad)\
**Post date:** [March 14, 2026, 1:57pm UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/3 "2026-03-14T13:57:52Z")

</div>

Hi Vincenzo

Attached (or [here](https://cernbox.cern.ch/files/spaces/eos/user/e/egramsta/forROOT/LargeSizeDemoScript.py)) is a simplified version of the full script which reproduces the problem. You can test it on [this file](https://cernbox.cern.ch/files/spaces/eos/user/e/egramsta/forROOT/user.egramsta.48785775._000523.output_ntup.root) on CERNBox (user/e/egramsta/forROOT/user.egramsta.48785775.\_000523.output\_ntup.root).

When I run this script in ROOT 6.36.04 the size/ev is 261.37 bytes (total size 10 MB) while with the ROOT built from master on Nov. 20th 2025 (6.39.01) it is 331.96 bytes/ev (13 MB).

[LargeSizeDemoScript.py](https://root-forum.cern.ch/uploads/short-url/4Ehxc0zvcxCBUmbGuE1vtJSnqFy.py) (1.5 KB)

best,

Eirik

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [March 14, 2026, 4:41pm UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/4 "2026-03-14T16:41:00Z")

</div>

Dear @Eirik_Gramstad ,

Thanks for the reproducer, as a first test I compiled on my machine different versions of ROOT and ran your script:

**ROOT master**

```auto
Total 332.47
Stored 125 branches in data15_63901.root with 38247 events
File Size : 12.72 MB

```

**ROOT 6.36.10**

```auto
Total 342.41
Stored 125 branches in data15_63610.root with 38247 events
File Size : 13.10 MB

```

**ROOT 6.36.04**

```auto
Total 342.41
Stored 125 branches in data15_63604.root with 38247 events
File Size : 13.10 MB

```

**ROOT 6.36.02**

```auto
Total 342.41
Stored 125 branches in data15_63602.root with 38247 events
File Size : 13.10 MB

```

So on my machine, all 6.36.\* versions have a slightly larger bytes/event metric than current master.

On the other hand, I ran your reproducer also on lxplus and I see very different results:

**LCG 109 - ROOT 6.38.00**

```auto
Total 331.98
Stored 125 branches in data15_63800.root with 38247 events
File Size : 12.70 MB

```

**LCG108a - ROOT 6.36.04**

```auto
Total 261.37
Stored 125 branches in data15_63604.root with 38247 events
File Size : 10.00 MB

```

**LCG108 - ROOT 6.36.02**

```auto
Total 261.37
Stored 125 branches in data15_63602.root with 38247 events
File Size : 10.00 MB

```

So here I see a behaviour such as the one you describe on your comment [Large changes in branch sizes in later builds of ROOT - #3 by Eirik\_Gramstad](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/3)

I don’t know yet why ROOT 6.36 on my machine is behaving so differently from ROOT 6.36 on lxplus. This will need investigation.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 28, 2026, 4:41pm UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/5 "2026-03-28T16:41:08Z")

</div>

Closed on March 28, 2026, 4:41pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [April 1, 2026, 11:18am UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/6 "2026-04-01T11:18:10Z")

</div>

Opened on April 1, 2026, 11:18am UTC



---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [April 1, 2026, 11:29am UTC](https://root-forum.cern.ch/t/large-changes-in-branch-sizes-in-later-builds-of-root/64753/7 "2026-04-01T11:29:47Z")

</div>

Dear @Eirik_Gramstad ,

This forum post triggered an investigation into the effects of compression of TTree datasets like yours. One of the key characteristics of the input file you shared is that it has many branches of type RVec where many and often all of the vectors are actually empty. It turns out that in this particular scenario the TTree dataset is compressed better by the ZLIB algorithm (in particular the vanilla ZLIB implementation, that’s what’s available on the lxplus node, and not the other popular zlib-ng implementation that is available on many Linux systems like my workstation) than the ZSTD algorithm. This went completely against our prior knowledge and understanding.

I’m mentioning this because the issue you see is due to the change in the compression algorithm used by Snapshot (and in fact can be seen even without changing ROOT version and using 6.36 but just changing the compression settings). The default was changed in 6.38 after internal discussion following the available knowledge. This was indicated in the release notes at [ROOT Version 6.38 Release Notes](https://root.cern/doc/v638/release-notes.html#snapshot) and it is also visible in your own script the first time you execute it with a ROOT version greater than 6.36 with the following message:

```auto
In ROOT 6.38, the default compression settings of Snapshot have been changed from 101 (ZLIB with compression level 1, the TTree default) to 505 (ZSTD with compression level 5). ...

```

So practically what you are seeing are the effects of the RDataFrame Snapshot compressing your data with ZSTD level 10 (ROOT compression setting 505, the default in 6.38) vs ZLIB level 1 (ROOT compression setting 101, the default before).

The details of the full investigation are available at [GitHub - vepadulano/ttree-lossless-compression-studies: This is a collection of programs to study the behaviour of different compression algorithms used by ROOT to compress datasets in the TTree format. · GitHub](https://github.com/vepadulano/ttree-lossless-compression-studies)

Following this, I have opened a PR to revert the Snapshot behaviour in light of the new knowledge [Revert choice to change default Snapshot TTree compression settings by vepadulano · Pull Request #21753 · root-project/root · GitHub](https://github.com/root-project/root/pull/21753)

In the meanwhile, you could try with a quick workaround by setting explicitly the compression settings for your Snapshot calls, e.g.:

```py
opts = ROOT.RDF.RSnapshotOptions()
opts.fCompressionAlgorithm = ROOT.RCompressionSetting.EAlgorithm.EValues.kZLIB
opts.fCompressionLevel = 1
df.Snapshot(output_treename, output_filename, columns_list, opts)

```

Cheers,  
Vincenzo
