summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishesh Handa <me@vhanda.in>2013-05-25 19:20:40 (GMT)
committerVishesh Handa <me@vhanda.in>2013-05-25 19:20:40 (GMT)
commit4437f5ab2d4448266e96fae981ba1c248727260c (patch)
tree14fd0e08c6b59eb57286a262b0916cb9b94cb1a4
parentf8747bc9d8fa916907d90b7f2bf84ffba923becb (diff)
VirtuosoQueryResultIteratorBackend: Avoid calling binding to cache the results
Copy the important parts of binding and call them manually instead of calling binding(i) which performs extra checks and returns the node. When transfering large number of results (over 50000) this leads to a minor performance increase.
-rw-r--r--backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp b/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp
index 158720d..9cb9e06 100644
--- a/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp
+++ b/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp
@@ -142,7 +142,11 @@ bool Soprano::Virtuoso::QueryResultIteratorBackend::next()
// we need to cache the values already here since there are situations where
// the query succeeds but getting values fails
for ( int i = 0; i < bindingCount(); ++i ) {
- binding( i );
+ // Avoid calling binding since it is more expensive!
+ d->bindingCache[i] = d->m_queryResult->getData( i+1 );
+ d->bindingCachedFlags.setBit( i );
+
+ setError( d->m_queryResult->lastError() );
if ( lastError() ) {
return false;
}