Hi there,
The last performance analysis that I did* on E-D-S vs. Tracker's RDF
store had some problems:
a. Certain people didn't want Evolution's UI to be running while the
test takes place.
b. Another problem was that the test was not replacing but always
appending new contacts.
c. The test for Tracker isn't using QtContacts' API.
d. The Tracker RDF store's test was doing the REPLACE and ORIGINAL in
one run, the two might interfere each other a bit. The ORIGINAL query
was also leaving behind traces of nco:Affiliation instances.
So
- To address a. I decided to shut it down and on top of that I decided
to use an empty addressbook that I fill up with 1000 contacts once.
Then I start running the tests.
I did the same thing for Tracker's RDF store. First I make 1000
contacts and then I start running the tests. No softwares are using
either of the stores while the tests run.
- To address b. I rewrote the test for E-D-S a bit. You can find both
tests attached to this E-mail.
- I have not yet addressed c. The QtContacts team have posted an E-mail
to the Tracker mailing list with some of their numbers:
http://mail.gnome.org/archives/tracker-list/2011-March/msg00035.html
I expect more numbers coming from them after they have started using
Tracker's latest INSERT OR REPLACE feature.
- I rewrote the Tracker RDF store's test to address d. (attached too).
It has no more indentation of the SPARQL to better mimic what
QtContacts will generate and the query was further optimized a bit.
Errata:
o. I used the branch "sparql-update" of Tracker
o. I used --disable-tracker-fts on Tracker (with FTS is Tracker's INSERT
OR REPLACE not expected to be as much faster as with FTS. FTS is
disabled on Harmattan). Without disabling FTS are in this particular
test case (due to INSERT OR REPLACE) results going to be different!
Note that I didn't clarify this last time.
o. I used default CFLAGS (-g -O2 afaik) on Tracker
o. Version in Evolution's about box is 2.30.3 (Debian testing) and E-D-S
from Debian testing too. This E-D-S uses a addressbook.db and
a addressbook.db.summary file when I look inside the folder.
I ran both tests several times and then I took the best scores for each:
Evolution Data Server:
$ ./eds-test
EDS 1000 contacts: 12.449457 (0 not replaced)
$ ./eds-test
EDS 1000 contacts: 12.388330 (0 not replaced)
$ ./eds-test
EDS 1000 contacts: 12.967997 (0 not replaced)
$ ./eds-test
EDS 1000 contacts: 12.391114 (0 not replaced)
$ ./eds-test
EDS 1000 contacts: 12.553720 (0 not replaced)
$
Tracker's RDF store. All contacts are replaced here:
./test-insert-or-replace
REPLACE: 1000 contacts: 12.579931
$ ./test-insert-or-replace
REPLACE: 1000 contacts: 12.722786
$ ./test-insert-or-replace
REPLACE: 1000 contacts: 13.674250
$ ./test-insert-or-replace
REPLACE: 1000 contacts: 13.083288
$ ./test-insert-or-replace
REPLACE: 1000 contacts: 13.539822
$
*) http://mail.gnome.org/archives/tracker-list/2011-March/msg00033.html
Cheers,
Philip
--
Philip Van Hoof
freelance software developer
Codeminded BVBA - http://codeminded.be
#include <libebook/e-book.h>
const gchar *vcard = "BEGIN:VCARD\n"
"VERSION:3.0\n"
"CLASS:PUBLIC\n"
"REV:2011-03-14T13:47:25Z\n"
"FN:First %d Last %d\n"
"N:Last %d;First %d;;;\n"
"EMAIL;WORK:[email protected]%d\n"
"TEL;TYPE=cell,voice:02141730585%d\n"
"NOTE;ENCODING=QUOTED-PRINTABLE:c1f1b12d-bc75-4d45-9a1f-b1efe934409f\n"
"END:VCARD\n";
static EContact *
new_test_contact (guint i)
{
EContact *contact;
gchar *str = g_strdup_printf (vcard, i,i,i,i,i,i);
contact = e_contact_new_from_vcard (str);
g_free (str);
return contact;
}
int main ()
{
EBook *book;
GError *error = NULL;
guint i, y = 1000, not_replaced = 0;
GTimer *timer;
GList *all = NULL;
GPtrArray *ids;
g_type_init ();
ids = g_ptr_array_new_with_free_func (g_free);
timer = g_timer_new ();
book = e_book_new_from_uri ("file:///tmp/test", &error);
if (error) {
g_critical ("%s\n", error->message);
return 0;
}
e_book_open (book, TRUE, &error);
if (error) {
g_critical ("%s\n", error->message);
return 0;
}
if (e_book_get_contacts (book, e_book_query_any_field_contains (""), &all, NULL)) {
while (all) {
g_ptr_array_add (ids, g_strdup (e_contact_get_const (all->data, E_CONTACT_UID)));
g_object_unref (all->data);
all = all->next;
}
}
g_timer_start (timer);
for (i = 0; i < y; i++) {
EContact *contact = NULL;
gchar *uid, *freeup = NULL;
if (i < ids->len) {
uid = g_ptr_array_index (ids, i);
} else {
not_replaced++;
freeup = uid = g_strdup_printf ("%d", i);
}
/* For this example to work we wouldn't have get the
* contact. But for sychronization we would need to
* get it (else we can't know the old values). */
if (!freeup && e_book_get_contact (book, uid, &contact, NULL)) {
e_book_remove_contact (book, uid, &error);
if (error) {
g_critical ("%s\n", error->message);
g_object_unref (contact);
g_free (freeup);
return 0;
}
} else {
g_print ("%s not found\n", uid);
not_replaced++;
}
g_free (freeup);
contact = new_test_contact (i);
e_book_add_contact (book, contact, &error);
if (error) {
g_critical ("%s\n", error->message);
g_object_unref (contact);
return 0;
}
e_book_commit_contact (book, contact, &error);
if (error) {
g_critical ("%s\n", error->message);
g_object_unref (contact);
return 0;
}
g_object_unref (contact);
}
g_timer_stop (timer);
g_print ("EDS %d contacts: %f (%d not replaced)\n",
y,
g_timer_elapsed (timer, NULL),
not_replaced);
g_ptr_array_unref (ids);
g_object_unref (book);
}
using GLib;
using Tracker;
using Tracker.Sparql;
const string insert_query_replace = "DELETE { ?r nao:hasProperty ?property . } WHERE { ?r a nco:PhoneNumber; nco:phoneNumber \"02141730585%d\"; nao:hasProperty ?property . } DELETE { ?r a nco:CarPhoneNumber, nco:BbsNumber, nco:PagerNumber, nco:VideoTelephoneNumber, nco:MessagingNumber, nco:VoicePhoneNumber, nco:CellPhoneNumber, nco:FaxNumber, nco:ModemNumber . } WHERE { ?r a nco:PhoneNumber; nco:phoneNumber \"02141730585%d\" . } INSERT { _:tel a nco:PhoneNumber ; nco:phoneNumber \"02141730585%d\" . } WHERE { OPTIONAL { ?r a nco:PhoneNumber; nco:phoneNumber \"02141730585%d\" . } FILTER(!bound(?r)) . } INSERT OR REPLACE { <mailto:[email protected]%d> a nco:EmailAddress ; nco:emailAddress \"[email protected]%d\" . } DELETE { <contact:r:%d> nco:hasAffiliation ?e . ?e a rdfs:Resource } WHERE { <contact:r:%d> a nco:PersonContact ; nco:hasAffiliation ?e } INSERT OR REPLACE { _:af1 a nco:Affiliation ; rdfs:label \"Work\" ; nco:hasEmailAddress <mailto:[email protected]%d> . _:af2 a nco:Affiliation ; rdfs:label \"Other\" ; nco:hasPhoneNumber ?tel . <contact:r:%d> a nco:PersonContact ; nco:nameGiven \"First %d\" ; nco:nameFamily \"Last %d\" ; nco:hasAffiliation _:af1 ; nco:hasAffiliation _:af2 ; nie:contentCreated \"2011-03-14T13:47:25\" ; nco:contactUID \"c1f1b12d-bc75-4d45-9a1f-b1efe934409f\" . } WHERE { ?tel nco:phoneNumber \"02141730585%d\" }";
int
main( string[] args )
{
uint i, y = 1000;
Timer t1 = new Timer ();
Connection c;
c = Connection.get ();
t1.start ();
for (i = 0; i < y; i++) {
c.update (insert_query_replace.printf (i,i,i,i,i,i,i,i,i,i,i,i,i));
}
t1.stop ();
print ("REPLACE: %u contacts: %f\n", y, t1.elapsed());
return 0;
}
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev
http://wiki.meego.com/Mailing_list_guidelines