[packagekit] compressing the files data

Richard Hughes hughsient at gmail.com
Fri Oct 26 07:16:17 PDT 2007


>From GetDetails we get a list of files in the package; this is a lot of
data:

/usr/share/powermanga/data/curves/bezier_curve_014.bin;/usr/share/powermanga/data/curves/bezier_curve_015.bin;/usr/share/powermanga/data/curves/bezier_curve_016.bin;/usr/share/powermanga/data/curves/bezier_curve_017.bin;/usr/share/powermanga/data/curves/...etc

Now, if you take the powermanga package, and just put the filedata into
a text file, it's 24k in size. We're validating this, transferring over
the bus and then transforming it into a \n delimited list for the tab
view. This takes time, and for a few hundred ms the CPU is at 100%.

I've been experimenting compressing these with gzip and bzip2 - and then
base64 encoding them for obvious reasons.

24K     files.txt
2.0K    files.gz
1.6K    files.bz2
5.3K    files.gz.base64
4.8K    files.bz2.base64

Quite a substantial decrease. The thing is, will we spend more time
encoding and decoding than actually sending over dbus - or am I missing
a trivial way we can compress these lists? Most of the data;data;data is
80% the same.

I'll do some profiling to see if we are doing anything stupid, but ideas
welcome.

Richard.





More information about the PackageKit mailing list