GNOME Bugzilla – Bug 319393
Allow dynamic Berkeley DBs
Last modified: 2013-09-10 13:42:05 UTC
I understand why EDS includes it's own copy of Berkeley DB, having used Evolution since before 1.0. However, it's a little wasteful: libdb isn't a small library (a stripped form is 700Kb) and it gets statically linked into EDS *twice*: once in the contacts "file" backend, and once into libedataserver. This is nearly 1.5M of library which isn't shared but could be. Debian has binary packages of all major versions of Berkeley DB and has a patch to dymanically link to the latest library with the same binary format (at the moment EDS dynamically links to db 4.2). This saves both time when fixing security bugs, disk space, and memory. Please consider adding a patch so that whilst the default action is to use the static library, it can be easily replaced with a dynamically linked library. Both systems with libdb 4.1 available as a dynamic library, and embedded systems were 1.4M of non-sharable memory is a serious problem, will love you.
Created attachment 53720 [details] [review] Dynamically link libdb This is the patch we're using to dynamically link to libdb. Obviously it isn't the complete solution but it is part of the way there.
Created attachment 53724 [details] [review] Revised patch This patch add --with-libdb41, which if set is used as the path to a libdb 4.1 install. If it isn't set, then the static libdb is built and used. For example, on Debian after install libdb4.1-dev, I can do: configure --with-libdb4.1=/usr and libdb-4.1.so is dynamically linked. This saves 700K of VM of memory on a system without any other libdb applications, and 1400K on a system which has already loaded libdb. It's also a lot faster to compile!
Created attachment 53725 [details] [review] Revised patch This patch actually works when statically linking.
adding memory keyword
Taking this up for some pre-commit testing love. Ross, I shall get back to you on this soon. thanks.
Ross, the patch looks fine - though there is some cruft (possibly from your dbus configurations) that need to be removed. Devasish is testing this a little more closely to measure the actual gains.
The DBus port has a much better test, I'll extract the patch later. It appears that db 4.2 and 4.3 is faster than 4.1 when tested, especially on non-Intel platforms, so by allowing distributions to use a packaged libdb they increase performance and save space.
Created attachment 58380 [details] [review] Revised Patch Same patch, revised so that it applies against the latest cvs head build,
Created attachment 58385 [details] [review] Improved patch This patch has an improved test and tells the user if they are using static or dynamic libdb.
harish, should this become a 1.7 target?
Any chance of this being reviewed for GNOME 2.16?
Ross - Yes. This is in the Evo 2.8 basket. Assigning this to Devasish. Andre - This _is_ a 1.7 target.
Patch committed to cvs head.