Is use_7z worth it? (was: Re: [57743] trunk/dports/graphics/ImageMagick/Portfile)

Ryan Schmidt ryandesign at macports.org
Tue Sep 15 19:14:36 PDT 2009


On Sep 15, 2009, at 20:30, Eric Hall wrote:

> On Tue, Sep 15, 2009 at 06:20:13PM -0700, ryandesign at macports.org  
> wrote:
>
>> Revision: 57743
>>          http://trac.macports.org/changeset/57743
>> Author:   ryandesign at macports.org
>> Date:     2009-09-15 18:20:06 -0700 (Tue, 15 Sep 2009)
>> Log Message:
>> -----------
>> ImageMagick: update to 6.5.6-1 to fix #21397 and switch to 7z  
>> distfile because it's smaller
>
> 	Is using 7z for downloads really worth the extra compile, etc.
> time for the decompressor required, and the (presumably) longer
> decompression time?

IMHO, definitely, which is why the use_7z option was added to MacPorts  
base. Processors in today's computers are extremely fast, so the  
decompression time is practically nothing. All ports should switch to  
7z or similar highly-compressed alternatives to gz and bz2 if  
available. lzma and xz are good choices too, though MacPorts doesn't  
yet have a use_xz option. The lzma, xz and 7z formats can all use the  
lzma compression algorithm.

Meanwhile, networks can be slow. While in the U.S. we may be used to  
fast broadband connections with unlimited downloads for a fixed  
monthly price, in other parts of the world, slower access over ISDN or  
dialup is still normal, which is probably billed by the minute or by  
the megabyte. Even if you're on broadband, conditions on your network  
or between you and the server may make the download slow, so  
decreasing the download size is good.


I did some tests on my 2.2-GHz Intel Core 2 Duo MacBook Pro running  
Snow Leopard from an external 5400-RPM 2.5" SATA drive connected via  
FireWire 800. Decompressing either the .7z or the .tar.bz2 version of  
the ImageMagick distfile took just over 3 seconds; there was  
practically no difference in time. Using .7z:


$ sudo port clean && sudo port checksum
--->  Cleaning ImageMagick
--->  Computing dependencies for ImageMagick
--->  Fetching ImageMagick
--->  Verifying checksum(s) for ImageMagick
$ time sudo port extract
--->  Computing dependencies for ImageMagick
--->  Extracting ImageMagick

real	0m3.142s
user	0m1.239s
sys	0m0.815s


Using .tar.bz2:


$ sudo port clean && sudo port checksum
--->  Cleaning ImageMagick
--->  Computing dependencies for ImageMagick
--->  Fetching ImageMagick
--->  Verifying checksum(s) for ImageMagick
rschmidt at 808 ImageMagick $ time sudo port extract
--->  Computing dependencies for ImageMagick
--->  Extracting ImageMagick

real	0m3.127s
user	0m2.435s
sys	0m0.605s


And compiling p7zip is a one-time operation which takes less than a  
minute.


$ time sudo port install p7zip
--->  Computing dependencies for p7zip
--->  Fetching p7zip
--->  Verifying checksum(s) for p7zip
--->  Extracting p7zip
--->  Applying patches to p7zip
--->  Configuring p7zip
--->  Building p7zip
--->  Staging p7zip into destroot
--->  Installing p7zip @9.04_0
--->  Activating p7zip @9.04_0
--->  Cleaning p7zip

real	0m47.720s
user	1m17.400s
sys	0m10.072s


The p7zip 9.04 bz2 distfile is 3.6 MB. This plus the size of the  
ImageMagick 6.5.6-1 7z distfile (5.7 MB) is only slightly larger than  
the size of the ImageMagick 6.5.6-1 bz2 distfile (8.6 MB). So if the  
user did not already have p7zip, then it will take a little longer  
this one time, but for every subsequent update, it's a win.




More information about the macports-dev mailing list