On Fr, 30 Okt 2009, Stefano Zacchiroli wrote:
> given that synchronous is set to "no") or else the Xapian
> message-by-message removal. If you already have some debugging code
Yes, that is it.
I did poor-mens timing by entering printfs around and seeing where
it takes time, and it is the callback, which boils down to
mu_storage_xapian_cleanup
and indeed there the commits are done one by one:
try {
/* this seems like an akward to get the specific doc;
defining a range... is there another way? */
Xapian::Query::Query q (Xapian::Query::OP_VALUE_RANGE,
MU_XAPIAN_MSG_PATH_ID,
msgpath,msgpath);
Xapian::Enquire enq(*storage->_db);
Xapian::MSet matches;
enq.set_query(q);
matches = enq.get_mset(0, 1);
transaction_begin (storage);
for (Xapian::MSet::const_iterator ci = matches.begin();
ci != matches.end(); ++ci) {
Xapian::docid id (ci.get_document().get_docid());
g_message ("xapian: deleting document %u", (guint)id);
storage->_db->delete_document(id);
}
transaction_commit (storage);
return MU_OK;
Most of the time is spent in the transaction_commit.
I guess that is the core of the problem that the xapian database
is opened/changed/written again and again.
Well. Now we only need someone to fix that ;-)
Maybe we have to have a callback_start_removal which boils down to
transaction_begin(storage), the normal callback doing the removals,
and a callback_end_removal which commits.
Puhhhhhh.... not for me. I probably can rewrite the code, but not without
*loads* of time which I don't have.
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining Associate Professor
JAIST Japan Advanced Institute of Science and Technology [email protected]
Vienna University of Technology [email protected]
Debian Developer (Debian TeX Task Force) [email protected]
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
YONKERS (n.)
(Rare.) The combined thrill of pain and shame when being caught in
public plucking your nostril-hairs and stuffing them into your
side-pocket.
--- Douglas Adams, The Meaning of Liff
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]