It's more efficient to gzip base16 encoded data than to gzip base64 data. /usr/dict/words is 900k of English text. If I base64 encode it and then gzip it (as you might do when sending the data via SOAP and a compressed transport), the result is 385k. But if I base16 encode it and then gzip it the result is smaller - 296k - even though base16 is less efficient..

Why? Base64 encoding breaks up the pattern so the compressor doesn't work as well. Base16 preserves byte boundaries. It's even more efficient to gzip, then base64 encode, then gzip. Summary:

data                      909k
gzip(data)                248k

gzip(base16(data))        296k   base16 is smaller
gzip(base64(data))        385k

gzip(base16(gzip(data)))  280k
gzip(base64(gzip(data)))  250k   base64 is smaller
tech
  2003-09-11 01:07 Z