Brotli Shared Dictionary Compression Results

The test fetched each of the URLs using an anonymous connection with no cookies and the requested user agent string:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Then, for each HTML response, it generated an HTML dictionary using the responses from all of the other URLs (excluding the URL being evaluated) to see how well a dictionary generated from the other pages would compress the page being tested.

Summary

Brotli supports a compression scale from 1 to 11 and Zstandard uses a scale from 1 to 22.

Brotli starts using external dictionaries for compression at level 5. Below those levels, dictionary-based compression is equivalent to not using dictionaries. The bulk of the savings for dictionary-based compression with brotli is already realized at level 5.

Zstandard supports external dictionaries starting at level 1. The bulk of the savings for using dictionary-based compression with Zstandard is usually seen by level 3 with incremental gains beyond that.

Using a custom 1024 KB compression dictionary with brotli for the requested pages resulted in HTML that was 7% to 58% smaller than brotli alone (31% average).

A dictionary was created using all of the provided URLs for future use. You can download it here. It is 886,129 bytes (87,714 compressed with brotli 11).

Run a new test

Details

https://news.ycombinator.com/news

Zstandard level 10 with a dictionary is 59% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 136,1626,08017%6,08017%100% (0% smaller)
Brotli 536,1624,98214%2,0966%42% (58% smaller)
Brotli 1136,1624,42112%1,8675%42% (58% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 136,1625,78116%4,74413%82% (18% smaller)
Zstandard 236,1625,69916%2,6467%46% (54% smaller)
Zstandard 336,1625,57515%2,4827%45% (55% smaller)
Zstandard 1036,1625,35915%2,1886%41% (59% smaller)
Zstandard 1936,1625,15614%1,9615%38% (62% smaller)
Zstandard 2236,1625,15614%1,9615%38% (62% smaller)

https://news.ycombinator.com/newest

Zstandard level 10 with a dictionary is 25% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 143,4727,08116%7,08116%100% (0% smaller)
Brotli 543,4725,88714%4,68311%80% (20% smaller)
Brotli 1143,4725,14112%4,0889%80% (20% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 143,4726,83616%5,88314%86% (14% smaller)
Zstandard 243,4726,73515%5,29912%79% (21% smaller)
Zstandard 343,4726,68015%5,32212%80% (20% smaller)
Zstandard 1043,4726,34915%4,77811%75% (25% smaller)
Zstandard 1943,4726,09514%4,47710%73% (27% smaller)
Zstandard 2243,4726,09514%4,47710%73% (27% smaller)

https://news.ycombinator.com/front

Zstandard level 10 with a dictionary is 49% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 135,8136,27718%6,27718%100% (0% smaller)
Brotli 535,8135,16314%2,6857%52% (48% smaller)
Brotli 1135,8134,58313%2,4147%53% (47% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 135,8136,01617%5,07114%84% (16% smaller)
Zstandard 235,8135,87416%4,18812%71% (29% smaller)
Zstandard 335,8135,80316%3,1489%54% (46% smaller)
Zstandard 1035,8135,55516%2,8258%51% (49% smaller)
Zstandard 1935,8135,36915%2,5327%47% (53% smaller)
Zstandard 2235,8135,36915%2,5327%47% (53% smaller)

https://news.ycombinator.com/newcomments

Zstandard level 10 with a dictionary is 30% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 144,5329,04620%9,04620%100% (0% smaller)
Brotli 544,5327,79418%5,77313%74% (26% smaller)
Brotli 1144,5326,51315%5,12212%79% (21% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 144,5328,78520%7,34917%84% (16% smaller)
Zstandard 244,5328,68319%6,74015%78% (22% smaller)
Zstandard 344,5328,56119%6,40514%75% (25% smaller)
Zstandard 1044,5328,31619%5,78013%70% (30% smaller)
Zstandard 1944,5328,13018%5,51512%68% (32% smaller)
Zstandard 2244,5328,13018%5,51512%68% (32% smaller)

https://news.ycombinator.com/ask

Zstandard level 10 with a dictionary is 36% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 130,3814,78816%4,78816%100% (0% smaller)
Brotli 530,3813,80213%2,5388%67% (33% smaller)
Brotli 1130,3813,28411%2,2577%69% (31% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 130,3814,43415%3,54812%80% (20% smaller)
Zstandard 230,3814,32914%3,03910%70% (30% smaller)
Zstandard 330,3814,27114%2,96210%69% (31% smaller)
Zstandard 1030,3814,15814%2,6439%64% (36% smaller)
Zstandard 1930,3813,99613%2,4168%60% (40% smaller)
Zstandard 2230,3813,99613%2,4168%60% (40% smaller)

https://news.ycombinator.com/show

Zstandard level 10 with a dictionary is 36% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 135,0125,74016%5,74016%100% (0% smaller)
Brotli 535,0124,66213%3,1189%67% (33% smaller)
Brotli 1135,0124,12212%2,8208%68% (32% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 135,0125,46816%4,49513%82% (18% smaller)
Zstandard 235,0125,35415%3,88011%72% (28% smaller)
Zstandard 335,0125,25115%3,53410%67% (33% smaller)
Zstandard 1035,0125,00514%3,2189%64% (36% smaller)
Zstandard 1935,0124,86414%2,9648%61% (39% smaller)
Zstandard 2235,0124,86414%2,9648%61% (39% smaller)

https://news.ycombinator.com/jobs

Zstandard level 10 with a dictionary is 35% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 124,2854,15117%4,15117%100% (0% smaller)
Brotli 524,2853,35214%2,33610%70% (30% smaller)
Brotli 1124,2852,98112%2,1179%71% (29% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 124,2854,05017%3,20013%79% (21% smaller)
Zstandard 224,2853,98916%2,86412%72% (28% smaller)
Zstandard 324,2853,95016%2,72911%69% (31% smaller)
Zstandard 1024,2853,64315%2,37910%65% (35% smaller)
Zstandard 1924,2853,56815%2,2079%62% (38% smaller)
Zstandard 2224,2853,56815%2,2079%62% (38% smaller)

https://news.ycombinator.com/item?id=41542409

Zstandard level 10 with a dictionary is 57% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 116,7364,05824%4,05824%100% (0% smaller)
Brotli 516,7363,20619%1,5109%47% (53% smaller)
Brotli 1116,7362,75216%1,3668%50% (50% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 116,7363,85223%2,18613%57% (43% smaller)
Zstandard 216,7363,78023%1,91111%51% (49% smaller)
Zstandard 316,7363,72922%1,72310%46% (54% smaller)
Zstandard 1016,7363,58021%1,5359%43% (57% smaller)
Zstandard 1916,7363,49021%1,4339%41% (59% smaller)
Zstandard 2216,7363,49021%1,4339%41% (59% smaller)

https://news.ycombinator.com/item?id=41550364

Zstandard level 10 with a dictionary is 16% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 1157,49124,28915%24,28915%100% (0% smaller)
Brotli 5157,49120,23713%17,53711%87% (13% smaller)
Brotli 11157,49117,01511%15,37510%90% (10% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 1157,49123,07115%21,34114%93% (7% smaller)
Zstandard 2157,49122,55214%20,36713%90% (10% smaller)
Zstandard 3157,49122,42514%19,68813%88% (12% smaller)
Zstandard 10157,49120,87313%17,49911%84% (16% smaller)
Zstandard 19157,49119,89413%16,22410%82% (18% smaller)
Zstandard 22157,49119,89413%16,22410%82% (18% smaller)

https://news.ycombinator.com/item?id=41519229

Zstandard level 10 with a dictionary is 25% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 190,26614,50616%14,50616%100% (0% smaller)
Brotli 590,26612,01813%9,51611%79% (21% smaller)
Brotli 1190,26610,20211%8,4479%83% (17% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 190,26613,88015%13,15815%95% (5% smaller)
Zstandard 290,26613,62515%11,22312%82% (18% smaller)
Zstandard 390,26613,36515%10,72612%80% (20% smaller)
Zstandard 1090,26612,56314%9,48511%75% (25% smaller)
Zstandard 1990,26611,98513%8,81810%74% (26% smaller)
Zstandard 2290,26611,98513%8,81810%74% (26% smaller)

https://news.ycombinator.com/item?id=41547395

Zstandard level 10 with a dictionary is 9% smaller than without a dictionary.

Brotli Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Brotli 1461,86358,14213%58,14213%100% (0% smaller)
Brotli 5461,86347,56710%44,30110%93% (7% smaller)
Brotli 11461,86339,9629%38,1948%96% (4% smaller)

Zstandard Compression

Compression LevelOriginal SizeCompressedRelative SizeWith DictionaryRelative to OriginalRelative to Compressed
Zstandard 1461,86355,54012%53,16212%96% (4% smaller)
Zstandard 2461,86353,91612%50,90311%94% (6% smaller)
Zstandard 3461,86352,52011%49,84911%95% (5% smaller)
Zstandard 10461,86347,96710%43,8359%91% (9% smaller)
Zstandard 19461,86345,22910%40,9549%91% (9% smaller)
Zstandard 22461,86345,22910%40,9549%91% (9% smaller)