festival icon indicating copy to clipboard operation
festival copied to clipboard

`Collection` compression

Open hinto-janai opened this issue 1 year ago • 0 comments

What

disk can (de)compress files with gzip when saving/reading. This includes the Collection.

collection.bin would be collection.bin.gz.

Collection with the current disk options have a 2:1 compression rate, e.g, 600 MB -> 300 MB.

Pros

  • Cuts disk usage in half
  • Manually running gzip collection.bin and gzip -d collection.bin.gz are both viable
  • Both compressed and non-compressed version would be cross-compatible

Cons

  • Deserialization takes 10x longer (0.18s -> 1.80s)
  • Serialization takes longer 5-6x longer (0.6s -> 3.3s)
  • Memory usage is greater (must hold gz bytes alongside regular bytes)

Todo

This feature is only be viable if the (de)compression times are minimal.

So, disk needs to be better before this can be considered.

hinto-janai avatar May 09 '23 15:05 hinto-janai