On Thu, 2008-08-07 at 19:40 +0100, Martyn Russell wrote: > Martyn Russell wrote: > > Laurent Aguerreche wrote:
> Phillip has a patch we can try for this. There are other means we use > in the indexer too which I will play with. Laurent, can you try the patch that I have attached? The more people test this kind of patches, the more sure we are of the performance impact. Please remove all of tracker's caches before testing: svn co http://svn.gnome.org.svn/tracker/branches/indexer-split cd indexer-split patch -p0 < crawler-more-than-one-file.diff ./autogen.sh --pr... && make && sudo make install killall -9 tracker killall -9 tracker-indexer rm -rf $HOME/.cache/tracker rm -rf $HOME/.local/share/tracker rm -rf /tmp/*tracker* trackerd -v 3 -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be
Index: src/trackerd/tracker-crawler.c =================================================================== --- src/trackerd/tracker-crawler.c (revision 1915) +++ src/trackerd/tracker-crawler.c (working copy) @@ -644,7 +644,7 @@ file_enumerate_next_cb (GObject *ob GFileEnumerator *enumerator; GFile *parent, *child; GFileInfo *info; - GList *files; + GList *files, *loop; enumerator = G_FILE_ENUMERATOR (object); @@ -670,26 +670,35 @@ file_enumerate_next_cb (GObject *ob } /* Files should only have 1 item in it */ - info = files->data; - child = g_file_get_child (parent, g_file_info_get_name (info)); - if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { - /* This is a bit of a hack, but we assume this is a - * recursive lookup because the current non-recursive - * path is NULL, meaning they have all been traversed - * already. - */ - if (crawler->private->handled_paths) { - add_directory (crawler, child); + loop = files; + + while (loop) { + info = loop->data; + + child = g_file_get_child (parent, g_file_info_get_name (info)); + + if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { + /* This is a bit of a hack, but we assume this is a + * recursive lookup because the current non-recursive + * path is NULL, meaning they have all been traversed + * already. + */ + if (crawler->private->handled_paths) { + add_directory (crawler, child); + } + } else { + add_file (crawler, child); } - } else { - add_file (crawler, child); - } - g_object_unref (child); + g_object_unref (child); + + loop = g_list_next (loop); + } + g_list_free (files); - /* Get next file */ + /* Get next files */ file_enumerate_next (enumerator, ed); } @@ -698,8 +707,8 @@ file_enumerate_next (GFileEnumerator *en EnumeratorData *ed) { g_file_enumerator_next_files_async (enumerator, - 1, - G_PRIORITY_DEFAULT, + 10, + G_PRIORITY_LOW, NULL, file_enumerate_next_cb, ed);
_______________________________________________ tracker-list mailing list tracker-list@gnome.org http://mail.gnome.org/mailman/listinfo/tracker-list