After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319393 - Allow dynamic Berkeley DBs
Allow dynamic Berkeley DBs
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
1.4.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Devashish Sharma
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2005-10-21 10:36 UTC by Ross Burton
Modified: 2013-09-10 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Dynamically link libdb (3.85 KB, patch)
2005-10-21 10:38 UTC, Ross Burton
none Details | Review
Revised patch (3.73 KB, patch)
2005-10-21 11:24 UTC, Ross Burton
none Details | Review
Revised patch (3.73 KB, patch)
2005-10-21 11:37 UTC, Ross Burton
none Details | Review
Revised Patch (4.19 KB, patch)
2006-01-30 09:13 UTC, Devashish Sharma
none Details | Review
Improved patch (4.74 KB, patch)
2006-01-30 11:00 UTC, Ross Burton
none Details | Review

Description Ross Burton 2005-10-21 10:36:17 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.
Comment 1 Ross Burton 2005-10-21 10:38:11 UTC
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.
Comment 2 Ross Burton 2005-10-21 11:24:07 UTC
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!
Comment 3 Ross Burton 2005-10-21 11:37:33 UTC
Created attachment 53725 [details] [review]
Revised patch

This patch actually works when statically linking.
Comment 4 André Klapper 2005-10-26 10:49:01 UTC
adding memory keyword
Comment 5 Harish Krishnaswamy 2006-01-18 11:12:47 UTC
Taking this up for some pre-commit testing love. 
Ross, I shall get back to you on this soon. thanks.
Comment 6 Harish Krishnaswamy 2006-01-30 06:15:19 UTC
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.
Comment 7 Ross Burton 2006-01-30 08:19:32 UTC
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.
Comment 8 Devashish Sharma 2006-01-30 09:13:50 UTC
Created attachment 58380 [details] [review]
Revised Patch

Same patch, revised so that it applies against the latest cvs head build,
Comment 9 Ross Burton 2006-01-30 11:00:48 UTC
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.
Comment 10 André Klapper 2006-04-09 11:17:19 UTC
harish, should this become a 1.7 target?
Comment 11 Ross Burton 2006-04-18 12:19:48 UTC
Any chance of this being reviewed for GNOME 2.16?
Comment 12 Harish Krishnaswamy 2006-04-18 13:37:34 UTC
Ross - Yes. This is in the Evo 2.8 basket. Assigning this to Devasish.
Andre - This _is_ a 1.7 target. 
Comment 13 Devashish Sharma 2006-04-24 11:07:37 UTC
Patch committed to cvs head.