[FriBidi] Experience of reducing FriBidi size?
Behdad Esfahbod
behdad at behdad.org
Tue Dec 7 11:54:30 PST 2010
Hi Mikael,
On 12/07/10 13:51, Mikael Hedlund wrote:
> For reference: when I compiled using GCC on Ubuntu, the C ref implementation
> binary was about 20 kB (dynamically linked) and the FriBidi lib was about 165
> kB (dynamically linked).
>
> 1) Are there some easy steps to reduce the size of the FriBidi binary, and
> does anyone have any experience how much the FriBidi binary in that case could
> be reduced?
> From a quick look in the code there seemed to be some fairly large tables
> which I assume could be reduced, plus some Hebrew related conversion routines
> to/from Unicode that are not needed in my case.
> Are there any nifty defines or other config parameters I have missed, that
> would reduce size?
Sure we can make this work out for you. First, lets configure without charset
converters, and without glib support:
./configure --disable-charsets --with-glib=no
Now build, and lets see how big it is:
$ ls -l lib/.libs/libfribidi.so.0.3.1
-rwxr-xr-x 1 behdad eng 150817 Dec 7 14:42 lib/.libs/libfribidi.so.0.3.1
Note however, that number includes debugging symbols. A better measure would
be either to call 'size' on it, or 'strip' it:
$ size lib/.libs/libfribidi.so.0.3.1
text data bss dec hex filename
77223 700 40 77963 1308b lib/.libs/libfribidi.so.0.3.1
So it's more like 80kb. Lets strip it and confirm:
$ ls -l lib/.libs/libfribidi.so.0.3.1
-rwxr-xr-x 1 behdad eng 84072 Dec 7 14:49 lib/.libs/libfribidi.so.0.3.1
Indeed, 84kb is all it is, bidi *and* arabic.
However, you can ask fribidi to compress its tables further:
Just switch into the lib/ dir and do:
$ make gen COMPRESSION=9
$ make
Lets check the size again:
$ ls -l .libs/libfribidi.so.0.3.1
-rwxr-xr-x 1 behdad eng 107833 Dec 7 14:52 .libs/libfribidi.so.0.3.1
$ size .libs/libfribidi.so.0.3.1
text data bss dec hex filename
33983 700 40 34723 87a3 .libs/libfribidi.so.0.3.1
$ ls -l .libs/libfribidi.so.0.3.1
-rwxr-xr-x 1 behdad eng 39016 Dec 7 14:54 .libs/libfribidi.so.0.3.1
So, the whole library is 40kb. Hope that's within your budget ;).
behdad
More information about the fribidi
mailing list