Wednesday, December 1, 2021

Firefox’s Optimized Zip Format

Taras Glek:

Unfortunately reading files started from ending precludes readahead. It is also suboptimal to read files from zip in random order.

The following creative interpretation of Zip spec results in optimized zip files[…]


Thus we have a sequentual-read-friendly zip file that can still be ready by zip tools that follow the spec.


At the time optimized jar change broke antivirus scanners, which further sped up Firefox startup :)

Update (2021-12-03): See also: Hacker News.

1 Comment RSS · Twitter

I'm not happy with this because it does not conform to the pkzip standard, as it does not have valid content past the first 4 bytes, which should be a local file header but is instead the central directory.

A safer solution may have been to bury the central dir in the first local header's extra space (with an ID that's not otherwise used), though that's limited to ~64KB, so it may not fit in there.

Leave a Comment