TFile compression - observations

I am using root 5.06/00 on windows XP. I generated the same TTree 8 times with compression level ranging from 1 to 8. The TTree has 323456 entries - the TTree contents are shown at the end of this post. The following table shows the size of the TFIle containing the TTree, the CPU time in seconds required to generate the output (all files involved on local machine) and the compression factor for three branches: a variable length array of UShort_t, a double and a float: comp CPU size x0[nx0] pulse vs level sec (kb) 1 6.516 6351 1.78 2.57 7.43 2 6.828 7195 1.52 2.35 7.84 3 6.891 7330 1.48 2.22 8.52 4 7.469 7099 1.49 2.32 9.54 5 7.609 7049 1.48 2.40 10.34 6 9.656 7024 1.48 2.39 10.94 7 10.469 7019 1.48 2.38 11.00 8 12.875 6994 1.48 2.38 11.00The only branches that appear to benefit from higher compression levels are the floats. The best compression performance appears to be for compression level = 1. Does anybody see different compression perfomance for primitive branches?
Here’s the TTree::Print() output for the compression=1 version

[code]******************************************************************************
*Tree :nt : Leap raw data *
*Entries : 323456 : Total = 42500693 bytes File Size = 6245426 *

  •    :          : Tree compression factor =   6.80                       *
    

*Br 0 :rhits : nx0/i:nx1:ny0:ny1 *
*Entries : 323456 : Total Size= 5191182 bytes File Size = 243000 *
*Baskets : 162 : Basket Size= 32000 bytes Compression= 21.33 *

*Br 1 :x0 : x0[nx0]/s *
*Entries : 323456 : Total Size= 2027066 bytes File Size = 1127764 *
*Baskets : 103 : Basket Size= 32000 bytes Compression= 1.78 *

*Br 2 :x1 : x1[nx1]/s *
*Entries : 323456 : Total Size= 2017692 bytes File Size = 1117025 *
*Baskets : 103 : Basket Size= 32000 bytes Compression= 1.80 *

*Br 3 :y0 : y0[ny0]/s *
*Entries : 323456 : Total Size= 2025632 bytes File Size = 1127394 *
*Baskets : 103 : Basket Size= 32000 bytes Compression= 1.78 *

*Br 4 :y1 : y1[ny1]/s *
*Entries : 323456 : Total Size= 2032228 bytes File Size = 1130117 *
*Baskets : 103 : Basket Size= 32000 bytes Compression= 1.78 *

*Br 5 :vs : v/F *
*Entries : 323456 : Total Size= 1297885 bytes File Size = 172162 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 7.43 *

*Br 6 :pulse : pulse/D *
*Entries : 323456 : Total Size= 2595712 bytes File Size = 1007083 *
*Baskets : 81 : Basket Size= 32000 bytes Compression= 2.57 *

*Br 7 :erate : erate/F *
*Entries : 323456 : Total Size= 1298026 bytes File Size = 30637 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 41.78 *

*Br 8 :xstage : xstage/S *
*Entries : 323456 : Total Size= 649256 bytes File Size = 4740 *
*Baskets : 20 : Basket Size= 32000 bytes Compression= 135.02 *

*Br 9 :ystage : ystage/S *
*Entries : 323456 : Total Size= 649256 bytes File Size = 4740 *
*Baskets : 20 : Basket Size= 32000 bytes Compression= 135.02 *

*Br 10 :zstage : zstage/S *
*Entries : 323456 : Total Size= 649256 bytes File Size = 4740 *
*Baskets : 20 : Basket Size= 32000 bytes Compression= 135.02 *

*Br 11 :VMcpBias : Vbias/F *
*Entries : 323456 : Total Size= 1298155 bytes File Size = 27802 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 46.04 *

*Br 12 :VMcpFront : VFront/F *
*Entries : 323456 : Total Size= 1298201 bytes File Size = 28639 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 44.69 *

*Br 13 :TargetErate : ErateT/F *
*Entries : 323456 : Total Size= 1298287 bytes File Size = 10640 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 120.29 *

*Br 14 :Pres : P/F *
*Entries : 323456 : Total Size= 1297971 bytes File Size = 11077 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 115.54 *

*Br 15 :IMcpBias : Ibias/F *
*Entries : 323456 : Total Size= 1298155 bytes File Size = 30695 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 41.70 *

*Br 16 :Thresh : tx0/s:tx1:ty0:ty1:tu0:tu1 *
*Entries : 323456 : Total Size= 3893752 bytes File Size = 32186 *
*Baskets : 121 : Basket Size= 32000 bytes Compression= 120.27 *

*Br 17 :UpperThresh : tux/s:tuy:tuu *
*Entries : 323456 : Total Size= 1947326 bytes File Size = 14700 *
*Baskets : 60 : Basket Size= 32000 bytes Compression= 130.60 *

*Br 18 :Walk : wx0/S:wx1:wy0:wy1:wu0:wu1 *
*Entries : 323456 : Total Size= 3893504 bytes File Size = 28435 *
*Baskets : 121 : Basket Size= 32000 bytes Compression= 136.12 *

*Br 19 :laserx : xl/I *
*Entries : 323456 : Total Size= 1298060 bytes File Size = 9480 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 135.02 *

*Br 20 :lasery : yl/I *
*Entries : 323456 : Total Size= 1298060 bytes File Size = 9480 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 135.02 *

*Br 21 :laserz : zl/I *
*Entries : 323456 : Total Size= 1298060 bytes File Size = 9480 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 135.02 *

*Br 22 :laserpower : lp/F *
*Entries : 323456 : Total Size= 1298232 bytes File Size = 9640 *
*Baskets : 40 : Basket Size= 32000 bytes Compression= 132.78 *

*Br 23 :FractureGuard : fg/s *
*Entries : 323456 : Total Size= 649405 bytes File Size = 4880 *
*Baskets : 20 : Basket Size= 32000 bytes Compression= 131.14 *
[/code][/code]

Ed,

I would not draw any conclusion from your test.
Your Tree contains branches with very high compression factors ,
indicating that your buffers contain repetitions of the same numbers or patterns.

Compression level 9 always give slightly better compression factors than level 1, but is much slower. We have set the default compression level to 1 as a good compromise between the compression factor and the compression time.

Rene