Skip to content

Commit 2dc7ec1

Browse files
committed
OPTIMIZATION: 50% speedup of `hdtSearch'.
Changed the end-of-line and flush command `std::endl' to emitting a regular newline character. This results in a 52% speedup, measured over the 10M triple SP²B dataset, according to the following command: ./hdtSearch -q "? ? ?" 10M.hdt > out.nt The detailed statistics are as follows (measured 5 times before and five times after this commit; the unit is seconds): - Old: 23.375 23.027 23.216 23.630 23.368 (avg. 23.32sec) - New: 10.876 11.227 11.077 11.110 11.072 (avg. 11.07sec)
1 parent 42da70f commit 2dc7ec1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libhdt/tools/hdtSearch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void iterate(HDT *hdt, char *query, ostream &out, bool measure, uint32_t offset)
115115
while(it->hasNext() && interruptSignal==0) {
116116
TripleString *ts = it->next();
117117
if(!measure)
118-
out << *ts << endl;
118+
out << *ts << '\n';
119119
numTriples++;
120120
}
121121
cerr << numTriples << " results in " << st << endl;

0 commit comments

Comments
 (0)