PaulStoffregen
Well-known member
Arduino IDE now supports ZST and XZ compression. I'm considering switching from BZ2. Downside is we lose compatibility with Arduino IDE 2.0.x and maybe even 2.1.x. So the big question is, are these better compression formats worth it?
XZ produces the smallest file sizes. ZST files are somewhat larger, but still a good improvement compared to BZ2. Both should cut download times, but we're talking modest gains like 20% to 30%.
ZST can (maybe) decompress faster. On Linux command line, XZ is slower than ZST but faster than BZ2. However, the speeds inside Arduino don't necessarily seem the same as running the command line program. You should especially be able to see the non-download overhead when switching between versions you're already installed once and Arduino has cached the downloaded files.
To give this a try, I've created alternate package index files.
To try, open Preferences and copy 1 of these into the additional URLs. Then in Boards Manager, uninstall Teensy then install again. Or try switching between versions. Arduino IDE caches downloads, so unless you find and delete the cached files, you'll probably only get to experience the download time once for each version (and remember 1.56 & 1.57 have the old toolchain and 1.58 & 0.59 have the new toolchain, which is the lion's share of the downloaded bytes).
If you give these a try, which has the best performance on your machine? Are the slightly larger downloads of ZST offset by its (claimed) faster decompression speed? Is the performance better or worse or about the same on Linux, Mac and Windows? Does Windows 10 vs 11 show any speed difference? I'm really curious to help how it works on your machine, and if I should switch away from BZ2 to either of these?
XZ produces the smallest file sizes. ZST files are somewhat larger, but still a good improvement compared to BZ2. Both should cut download times, but we're talking modest gains like 20% to 30%.
ZST can (maybe) decompress faster. On Linux command line, XZ is slower than ZST but faster than BZ2. However, the speeds inside Arduino don't necessarily seem the same as running the command line program. You should especially be able to see the non-download overhead when switching between versions you're already installed once and Arduino has cached the downloaded files.
To give this a try, I've created alternate package index files.
Code:
Original BZ2 Compression:
https://www.pjrc.com/teensy/package_teensy_index.json
ZST Compression:
https://www.pjrc.com/teensy/package_teensy_zst_index.json
XZ Compression:
https://www.pjrc.com/teensy/package_teensy_xz_index.json
To try, open Preferences and copy 1 of these into the additional URLs. Then in Boards Manager, uninstall Teensy then install again. Or try switching between versions. Arduino IDE caches downloads, so unless you find and delete the cached files, you'll probably only get to experience the download time once for each version (and remember 1.56 & 1.57 have the old toolchain and 1.58 & 0.59 have the new toolchain, which is the lion's share of the downloaded bytes).
If you give these a try, which has the best performance on your machine? Are the slightly larger downloads of ZST offset by its (claimed) faster decompression speed? Is the performance better or worse or about the same on Linux, Mac and Windows? Does Windows 10 vs 11 show any speed difference? I'm really curious to help how it works on your machine, and if I should switch away from BZ2 to either of these?
Last edited: