Opened 3 years ago
Last modified 3 years ago
#7274 assigned enhancement
Make Mac distribution dmg file smaller using LZMA compression
| Reported by: | Tom Goddard | Owned by: | Tom Goddard |
|---|---|---|---|
| Priority: | moderate | Milestone: | |
| Component: | Platform | Version: | |
| Keywords: | Cc: | chimerax-programmers | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description (last modified by )
Zach observed that the Mac distribution dmg file (.dmg) can be made much smaller (60% of dmg size) using instead an LZMA compressed tar file (.tar.xz made with tar -cfJ), ticket #7250 comment 13. This would reduce our 400 Mbyte Mac distribution to about 240 Mbytes.
The dmg format supports LZMA compression but only from macOS 10.15 onward, and testing it gave dmg size that was 70% of the current dmg (which uses zlib level 1 compression). But we currently distribute on macOS 10.14. I tested on our macOS 10.14 build machine essex.cgl.ucsf.edu and the LZMA compressed dmg indeed fails to mount (error is "corrupted file", using command "hdiutil attach cx1.4_lzma.dmg").
This does not seem like a good enough reason to drop 10.14 support. We could provide two dmg files one for 10.14 and one for 10.15 and later. We'd want the download page to only show the appropriate file. That can only work if the user agent identified by the web browser on 10.14 identifies the OS vesion as 10.14. Have to check if it does.
Making the distribution file size 70% of current size would offset somewhat the size increase in going from a Mac Intel dmg to a Mac Universal (ARM + Intel) dmg which increases the size to 156% of current size (ticket #7222), making the universal dmg only 10% bigger than the current Intel-only distribution.
The hdiutil Mac command that makes dmg files offers 5 compression formats but LZMA looks most promising. Here are sizes for theh different formats
241M cx1.4.tar.xz (not a dmg, 60% of default size) 281M cx1.4_lzma.dmg (macos 10.15 or later, 70% of default size) 324M cx1.4_bzip2.dmg (deprecated in macOS 12, 85% of default size) 352M cx1.4_lzfse.dmg 359M cx1.4_zlib9.dmg (90% of default size) 400M cx1.4.tar.gz 403M cx1.4_zlib.dmg (default) 442M cx1.4_adc.dmg 1.2G cx1.4.tar
Commands for making LZMA file and tar.xz file are
/usr/bin/hdiutil create cx1.4_lzma.dmg -srcfolder ~/Desktop/ChimeraX-1.4.app -volname ChimeraXInstaller -fs HFS+ -format ULMO tar -cJf cx1.4.tar.xz ~/Desktop/ChimeraX-1.4.app
It is a little surprising that the dmg LZMA reduces file size to 70% while tar LZMA reduces to 60%. The Mac LZMA uses compression level 6 the same as tar. Compression levels go from 0 to 9 but Mac OS only offers level 6 (https://openradar.appspot.com/FB8739821 and https://developer.apple.com/documentation/compression/compression_lzma).
Change History (5)
comment:1 by , 3 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 3 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 3 years ago
comment:5 by , 3 years ago
Added LZMA dmg compression (format ULMO) to Mac M1 technology preview build (ticket #4663) since that will only be used on macOS 11 and 12 where LZMA is available.
It looks like the Mac OS 10.14 downloads could be recognized from the web server. Here are example user agents we see in plato logs
macOS 10.13
macOS 10.14
macOS 10.15
macOS 11
macOS 12
Looking at how many Mac server log entries there are for each platform using the July 1-12 log (12 days)
It appears that 10.14 is still about 5% of hits on our RBVI server.
Strange that there are so many 10_15. But my macOS 12.4 laptop reports as 10_15 in the plato sever log. So probably most Mac systems newer than 10_15 are reporting 10_15 instead of 11 or 12 since 11 and 12 are likely the majority of all Mac systems now.