Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 1995 05:41:34 +0200
From:      Heikki Suonsivu <hsu@cs.hut.fi>
To:        michael butler <imb@scgt.oz.au>
Cc:        freebsd-current@freefall.FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/pppd RELNOTES
Message-ID:  <199511120341.FAA08651@shadows.cs.hut.fi>
In-Reply-To: michael butler's message of 11 Nov 1995 13:06:34 %2B0200

next in thread | raw e-mail | index | archive | help

   > Has anyone looked at it, if it could be modified to do zip compression

   ZIP is computationally expensive .. you'll speed most of your time in the

Huh?

hsu#hauki.clinet.fi Sun 37: time gzip -1 < csh > /dev/null
real 0:00.60; user 0.582; system 0.031; cpu 101.6%; swaps 0; 
disk reads 0; disk writes 0; average size 687; max size 192
hsu#hauki.clinet.fi Sun 38: time gzip -1 < csh > /dev/null
real 0:00.60; user 0.578; system 0.038; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 718; max size 192
hsu#hauki.clinet.fi Sun 39: time gzip -1 < csh > /dev/null
real 0:00.61; user 0.583; system 0.031; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 706; max size 192
hsu#hauki.clinet.fi Sun 40: time gzip -1 < csh > /dev/null
real 0:00.60; user 0.579; system 0.038; cpu 100.0%; swaps 0;
disk reads 0; disk writes 0; average size 718; max size 192

So its about 0.6s

hsu#hauki.clinet.fi Sun 41: time compress  < csh > /dev/null
real 0:00.75; user 0.644; system 0.070; cpu 94.6%; swaps 0; 
disk reads 5; disk writes 0; average size 741; max size 450
hsu#hauki.clinet.fi Sun 42: time compress < csh > /dev/null
real 0:00.73; user 0.662; system 0.038; cpu 94.5%; swaps 0; 
disk reads 0; disk writes 0; average size 763; max size 450
hsu#hauki.clinet.fi Sun 43: time compress < csh > /dev/null
real 0:00.67; user 0.651; system 0.038; cpu 101.4%; swaps 0; 
disk reads 0; disk writes 0; average size 757; max size 450
hsu#hauki.clinet.fi Sun 44: time compress < csh > /dev/null
real 0:00.71; user 0.699; system 0.031; cpu 101.4%; swaps 0; 
disk reads 0; disk writes 0; average size 756; max size 450

compress -b16 takes more, 0.65s, but as predictor-1 uses only 15 bits:

hsu#hauki.clinet.fi Sun 45: time compress -b15 < csh > /dev/null
real 0:00.52; user 0.502; system 0.031; cpu 101.9%; swaps 0; 
disk reads 0; disk writes 0; average size 737; max size 450
hsu#hauki.clinet.fi Sun 46: time compress -b15 < csh > /dev/null
real 0:00.53; user 0.481; system 0.054; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 761; max size 450
hsu#hauki.clinet.fi Sun 47: time compress -b15 < csh > /dev/null
real 0:00.53; user 0.476; system 0.053; cpu 98.1%; swaps 0; 
disk reads 0; disk writes 0; average size 787; max size 450
hsu#hauki.clinet.fi Sun 48: time compress -b15 < csh > /dev/null
real 0:00.54; user 0.506; system 0.022; cpu 96.2%; swaps 0; 
disk reads 0; disk writes 0; average size 795; max size 450
hsu#hauki.clinet.fi Sun 49: time compress -b15 < csh > /tmp/csh.Z
real 0:00.60; user 0.464; system 0.106; cpu 93.3%; swaps 0; 
disk reads 0; disk writes 6; average size 784; max size 446

compress -b15 wins by 20-30%, 0.5s

But lets look at decompression times!

hsu#hauki.clinet.fi Sun 50: time gzip -1 < csh > /tmp/csh.gz
real 0:00.78; user 0.571; system 0.064; cpu 80.7%; swaps 0; 
disk reads 0; disk writes 5; average size 705; max size 192
hsu#hauki.clinet.fi Sun 51: time compress -d < /tmp/csh.Z > /dev/null
real 0:00.34; user 0.302; system 0.046; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 770; max size 452

hsu#hauki.clinet.fi Sun 52: time compress -d < /tmp/csh.Z > /dev/null
real 0:00.34; user 0.334; system 0.015; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 749; max size 452
hsu#hauki.clinet.fi Sun 53: time compress -d < /tmp/csh.Z > /dev/null
real 0:00.33; user 0.322; system 0.023; cpu 103.0%; swaps 0; 
disk reads 0; disk writes 0; average size 750; max size 452
hsu#hauki.clinet.fi Sun 54: time compress -d < /tmp/csh.Z > /dev/null
real 0:00.33; user 0.293; system 0.045; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 794; max size 452

compress -d takes 0.3s.

hsu#hauki.clinet.fi Sun 55: time gzip -d < /tmp/csh.gz > /dev/null
real 0:00.19; user 0.172; system 0.030; cpu 105.2%; swaps 0; 
disk reads 0; disk writes 0; average size 800; max size 178
hsu#hauki.clinet.fi Sun 56: time gzip -d < /tmp/csh.gz > /dev/null
real 0:00.19; user 0.192; system 0.015; cpu 105.2%; swaps 0; 
disk reads 0; disk writes 0; average size 773; max size 162
hsu#hauki.clinet.fi Sun 57: time gzip -d < /tmp/csh.gz > /dev/null
real 0:00.19; user 0.184; system 0.024; cpu 105.2%; swaps 0; 
disk reads 0; disk writes 0; average size 750; max size 150
hsu#hauki.clinet.fi Sun 58: time gzip -d < /tmp/csh.gz > /dev/null
real 0:00.20; user 0.178; system 0.032; cpu 100.0%; swaps 0; 
disk reads 0; disk writes 0; average size 738; max size 138

gzip -d takes 0.2s.

compress -b15   0.5s + 0.3s = 0.8s
gzip -1         0.6s + 0.2s = 0.8s

I can't see any difference, except in the file sizes:

hsu#hauki.clinet.fi Sun 59: ls -l /tmp/csh.{Z,gz}
-rw-------   1 root     bin        170735 Nov 12 05:16 /tmp/csh.Z
-rw-------   1 root     bin        138760 Nov 12 05:16 /tmp/csh.gz

This was on a P90, -current from two weeks back.

Disclaimer: csh doesn't necessarily represent "standard data pattern on
TCP/IP links" :-).

-- 
Heikki Suonsivu, T{ysikuu 10 C 83/02210 Espoo/FINLAND,
hsu@cs.hut.fi  home +358-0-8031121 work -4513377 fax -4555276  riippu SN



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511120341.FAA08651>