[GRASS-user] Can I turn off compression

Ken Mankoff mankoff at gmail.com
Mon Mar 2 07:58:54 PST 2020


Hi,

Thanks for the replies. Yes I found LZ4 to be the best. In answer to Vaclav suggesting general interest, here are some code and results so you can test this on your own system which will have different disk/CPU/RAM speeds. I am only reporting time, not disk usage here.

I'm not totally sure how to find the size of a GRASS raster from within GRASS. I could go to the OS to find it. A better report would include a scatter plot of time v. size, but I only cared about time.

Summary: Use LZ4 compression within GRASS. For any maps that already exist, it isn't clear if LZ4 or uncompressed is faster. They seem about equal on my system using this as a test:

r.mapcalc "compressed = 42"
r.mapcalc "uncompressed = 42"
r.compress -u map=uncompressed

/usr/bin/time -f %E parallel -j 1 -N 0 r.mapcalc '"foo = compressed * 2"' ::: $(seq 10)
/usr/bin/time -f %E parallel -j 1 -N 0 r.mapcalc '"foo = uncompressed * 2"' ::: $(seq 10)


  -k.
  

grass -c EPSG:3413 ./G

g.region w=0 e=10000 s=0 n=10000 res=1 -pa

export GRASS_OVERWRITE=1

for C in RLE LZ4 BZIP2; do
  export GRASS_COMPRESSOR=${C}
  echo -n "${C} ": 
  /usr/bin/time -f %E parallel -j 1 -N 0 r.mapcalc '"foo = 42"' ::: $(seq 10)
done

export GRASS_COMPRESSOR=ZLIB
for ZL in $(seq -1 10); do
  export GRASS_ZLIB_LEVEL=${ZL}
  echo -n "ZLIB ${ZL} ": 
  /usr/bin/time -f %E parallel -j 1 -N 0 r.mapcalc '"foo = 42"' ::: $(seq 10)
done

RLE     :0:17.39
LZ4     :0:14.51
BZIP2   :0:24.05
ZLIB -1 :0:22.49
ZLIB  0 :0:19.14
ZLIB  1 :0:20.31
ZLIB  2 :0:20.05
ZLIB  3 :0:19.87
ZLIB  4 :0:22.72
ZLIB  5 :0:22.49
ZLIB  6 :0:22.25
ZLIB  7 :0:22.32
ZLIB  8 :0:22.26
ZLIB  9 :0:22.67
ZLIB 10 :0:19.77




More information about the grass-user mailing list