jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/2] jena git commit: JENA-1059: Fine tune space allocation for lists.
Date Sun, 01 Nov 2015 20:44:09 GMT
JENA-1059: Fine tune space allocation for lists.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/364a9ddc
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/364a9ddc
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/364a9ddc

Branch: refs/heads/master
Commit: 364a9ddcd56757a181ef929d3d02937bda76baef
Parents: 0433e9e
Author: Andy Seaborne <andy@apache.org>
Authored: Sun Nov 1 17:11:36 2015 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Sun Nov 1 17:11:36 2015 +0000

----------------------------------------------------------------------
 .../java/org/apache/jena/sparql/modify/UpdateEngineWorker.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/364a9ddc/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
index b70b9ea..7f8e853 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
@@ -506,6 +506,7 @@ public class UpdateEngineWorker implements UpdateVisitor
         return el ;
     }
 
+    // JENA-1059
     // execDelete ; execInsert
     // Quads involving only IRIs and literals do not change from binding to
     // binding so any inserts, rather than repeatedly if they are going to be
@@ -513,8 +514,11 @@ public class UpdateEngineWorker implements UpdateVisitor
     // instantiation to instantiation.
 
     private static Pair<List<Quad>, List<Quad>> split(List<Quad>
quads) {
+        // Guess size.
+        //    Pre-size in case large (i.e. 10K+). 
         List<Quad> constQuads = new ArrayList<>(quads.size()) ;
-        List<Quad> templateQuads = new ArrayList<>(quads.size()) ;
+        //    ... in which case we assume the templated triples are small / non-existent.
+        List<Quad> templateQuads = new ArrayList<>() ;
         quads.forEach((q)-> {
             if ( constQuad(q))
                 constQuads.add(q) ;


Mime
View raw message