[haiku-development] Re: hpkgs and compression

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 20 Mar 2014 23:11:48 +0100

On 10.03.2014 18:35, Jonathan Schleifer wrote:
[...]
* Data is not block aligned and often causes a read of 2 blocks when
only 1 would be necessary.
[...]
I know that one requirement was "We don't want to download the hpkg
and then wait for the decompression" and that compressed packages
are quite handy for the Live CD. So here's my proposal:

* Store the data uncompressed in the hpkg itself and block-align it.
[...]

First of all what blocks are you talking about? FS blocks? The block size of the target FS is not known when the package is created. Page alignment would be natural as that's the file caches unit as well, for packages containing lots of small files it does waste quite a bit of memory, though.

Anyway, have you done any benchmarks that support your alignment theory? Due to caching it is usually not detrimental to read two pages when you need only one at one point, since you'll likely need the other page later anyway.

If the data is compressed, the compressed units need to be even larger to allow for a reasonable compression ratio. I doubt that aligning the data is particularly helpful in this situation. In fact it would only reduce data density and thus the compression ratio (a chunky format is needed for fast random access).

CU, Ingo

Other related posts: