[LAD] Lightweight LV2 implementation (Was: RDF libraries)

David Robillard d at drobilla.net
Thu Sep 29 05:48:17 UTC 2011

On Mon, 2011-02-28 at 17:24 +0100, Olivier Guilyardi wrote:
> Once you remove the glib dep, I should be able to tell you what size I get when
> compiling with the Android NDK. I have checked again, and 100Kb is good in my
> case. FYI, APK packaging uses zip compression.

I just released serd-0.5.0[1], sord-0.5.0[2], and lilv-0.5.0[3] which
all have zero dependencies except each other and the C standard library.
All work on at least GNU/Linux (Debian Testing), Mac OS X (10.6), and
Windows 7 (under MingW), but I havn't tried any cross compiling yet.

You should be able to easily get less than 100Kb.  Compiling static
libraries for 32-bit i386 with -Os I get:

16K	./sord/build/libsord-0.a
36K	./lilv/build/liblilv-0.a
28K	./serd/build/libserd-0.a

Which is 80k total.  It compresses well:

8.0K	./sord/build/libsord-0.a.zip
12K	./lilv/build/liblilv-0.a.zip
16K	./serd/build/libserd-0.a.zip

Which is 36k total.

The code is not really optimized for binary size (e.g. there are many
more functions than there could be), but this seems good enough for any
reasonable application (certainly a dramatic improvement over the
several megs of Redland or GLib, anyway).  Quite a bit of this code is
unused in a typical LV2 host (e.g. SerdWriter), so if you're building a
static app you can probably coax GCC into culling it down even
further[4]... if not, I could add a --read-only compile option to omit
the writing stuff which should save a bit more.

Let me know how it goes with the Android NDK, I havn't tried.


[1] http://drobilla.net/2011/09/29/serd-0-5-0/
[2] http://drobilla.net/2011/09/29/sord-0-5-0/
[3] http://drobilla.net/2011/09/29/lilv-0-5-0/
[4] http://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html

More information about the Linux-audio-dev mailing list