<div dir="ltr">hi,there<div><br></div><div>I use xapian to build index,I found add_document cost lots of time(I did not use commit).</div><div>In my computer, add one doc cost more then 60ms. It's a huge number for me to add one doc.</div>
<div><br></div><div><b>so, do you have some solutions to improve this?</b></div><div><br></div><div><br></div><div>This is my code:</div><div><br></div><div><div>gettimeofday( &start, NULL );</div><div> </div>
<div>Xapian::docid did = db->add_document(doc);</div><div>if (did % 5000 == 0)</div><div> printf("docid: %d\n", did);</div><div> </div><div>gettimeofday( &end, NULL );</div><div>timeuse = 1000000 *( end.tv_sec - start.tv_sec ) + end.tv_usec - start.tv_usec; </div>
<div>printf("add time used: %d us\n", timeuse);</div></div><div><br></div><div><b>add time used: 63373 us</b><br></div></div>