PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 858 - pyside-rcc produces bigger files than pyrcc4
: pyside-rcc produces bigger files than pyrcc4
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: pyside-tools
: HEAD
: PC Mac OS
: P3 enhancement
Assigned To: Marcelo Lira
:
:
:
  Show dependency treegraph
 
Reported: 2011-05-16 21:18 EEST by Thomas Perl
Modified: 2011-06-22 20:14 EEST (History)
8 users (show)

See Also:


Attachments
First try on a patch (uses only 1/3 of the space for printable chars) (897 bytes, application/octet-stream)
2011-05-16 21:19 EEST, Thomas Perl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Perl 2011-05-16 21:18:41 EEST
According to a post on the mailing list:

> I just regenerated ui.py and resource_rc.py and surprisingly
> resource_rc.py generated from pyside-rcc (4.51 Mb) is four(!) times as
> big as the one generated by pyrcc4 (1.18 Mb).

I'll attach a simple patch for the beginning, but I'm sure we can squeeze out
even more space efficiency when writing the file.
Comment 1 Thomas Perl 2011-05-16 21:19:28 EEST
Created attachment 325 [details]
First try on a patch (uses only 1/3 of the space for printable chars)

First try on a patch. Feel free to suggest additional changes :)
Comment 2 Thomas Perl 2011-05-16 21:42:19 EEST
Some more thoughts about this:

* The range of printable characters should probably be < 127, not <= 127, but
I'm not sure.
* The line width could be re-estimated based on printable characters to fill
more of the 80 chars.
* Instead of using \ at the end of each line, """ """ (multi-line strings)
could be used, if the line breaks are removed afterwards (but that would
decrease load performance a bit?).

I haven't looked at what methods pyrcc4 uses, but someone who looks at its
output could probably also get some ideas about how to optimize the output of
pyside-rcc.

If size is really important, zlib.decompress() could be used at runtime to
decompress the string, but that would require pyside-rcc to compress the data
on the fly. If such a method is performance-increasing or -decreasing depends
on whether loading the generated file is I/O-bound or CPU-bound (and that
probably depends on the target platform, I'd guess on mobile platforms reading
from MMC/SD cards, it would be I/O bound, anyway, so compression could even
give a performance boost there, but of course that's just an uninformed guess
;).
Comment 3 Marcelo Lira 2011-06-03 16:28:01 EEST
Fixed in PySide-Tools/84d20d65.

Thanks Thomas.
Comment 4 renato filho 2011-06-22 20:14:08 EEST
release 1.0.4