Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

bzip2 comes out the clear winner in compressing TXR Lisp compiled files, and has the smallest code size (by far) in its shared library form:

  0:[0519:020528]:sun-go:~/txr/stdlib$ ls -l compiler.tlo*
  -rw-rw-r-- 1 kaz kaz 211119 May 12 11:06 compiler.tlo
  -rw-rw-r-- 1 kaz kaz  37615 May 19 02:01 compiler.tlo.bz2
  -rw-rw-r-- 1 kaz kaz  49200 May 19 02:01 compiler.tlo.gz
  -rw-rw-r-- 1 kaz kaz  38360 May 19 02:04 compiler.tlo.xz
  -rw-rw-r-- 1 kaz kaz  52387 May 19 02:02 compiler.tlo.zst
  0:[0519:020535]:sun-go:~/txr/stdlib$ size /lib/i386-linux-gnu/libbz2.so.1.0.4
     text    data     bss     dec     hex filename
    60511    3520       4   64035    fa23 /lib/i386-linux-gnu/libbz2.so.1.0.4
  0:[0519:020544]:sun-go:~/txr/stdlib$ size /lib/i386-linux-gnu/libz.so.1.2.11
     text    data     bss     dec     hex filename
   115537     588       4  116129   1c5a1 /lib/i386-linux-gnu/libz.so.1.2.11
  0:[0519:020653]:sun-go:~/txr/stdlib$ size /lib/i386-linux-gnu/liblzma.so.5.2.2
     text    data     bss     dec     hex filename
   166862     900       4  167766   28f56 /lib/i386-linux-gnu/liblzma.so.5.2.2
  0:[0519:020658]:sun-go:~/txr/stdlib$ size /usr/lib/i386-linux-gnu/libzstd.so.1.3.3 
     text    data     bss     dec     hex filename
   508674     492      20  509186   7c502 /usr/lib/i386-linux-gnu/libzstd.so.1.3.3
Code bloat: bz2 < z < xz < zstd

Compression: bz2 > xz > z > zstd

zstd with level -19 compression beats default gz to third place:

  -rw-rw-r-- 1 kaz kaz  41163 May 19 02:17 compiler.tlo.zst-19
gzip squeezes another 2K out with level -9, staying third:

  -rw-rw-r-- 1 kaz kaz  47206 May 19 02:19 compiler.tlo.gz-9
xz's output doesn't change at -9 level (relative to its default -6).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: