diff --git a/.gitignore b/.gitignore
index cf4397b..76e8aa5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*
!/**/
!**/*.java
+!**/*.xml
!**/*.jar
!**/*.md
!.gitignore
diff --git a/pom.xml b/pom.xml
index ec68f1f..d85ace9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,10 @@
8
8
8
+ 1.21
+ 2.6
+ 3.5.1
+ 1.12
@@ -59,10 +63,16 @@
4.12
test
+
+ org.openjdk.jmh
+ jmh-core
+ ${jmh.version}
+ test
+
redis.clients
jedis
- 3.0.1
+ 3.1.0
@@ -79,6 +89,27 @@
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ ${maven-build-helper-plugin.version}
+
+
+ add-test-source
+ generate-test-sources
+
+ add-test-source
+
+
+
+ src/test/perf
+
+
+
+
+
+
org.codehaus.mojo
cobertura-maven-plugin
@@ -94,11 +125,28 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.1
+ ${maven-compiler-plugin.version}
1.8
1.8
+
+
+
+ testCompile
+
+
+
+
+
+ org.openjdk.jmh
+ jmh-generator-annprocess
+ ${jmh.version}
+
+
+
+
+
org.sonatype.plugins
@@ -118,6 +166,32 @@
false
+
+
+ maven-assembly-plugin
+ ${maven-assembly-plugin.version}
+
+ src/main/assembly/perf-tests.xml
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+ true
+
+
+ org.openjdk.jmh.Main
+
+
+
+
+
+
+
@@ -149,7 +223,7 @@
true
-Xdoclint:none
- -Xdoclint:none
+
diff --git a/src/main/assembly/perf-tests.xml b/src/main/assembly/perf-tests.xml
new file mode 100644
index 0000000..57d9eba
--- /dev/null
+++ b/src/main/assembly/perf-tests.xml
@@ -0,0 +1,28 @@
+
+ perf-tests
+
+ jar
+
+ false
+
+
+ /
+ true
+ true
+ test
+
+
+
+
+ ${project.build.directory}/test-classes
+ /
+
+ **/*
+
+ true
+
+
+
\ No newline at end of file
diff --git a/src/main/java/io/redisearch/client/Client.java b/src/main/java/io/redisearch/client/Client.java
index 17dac52..54161a6 100644
--- a/src/main/java/io/redisearch/client/Client.java
+++ b/src/main/java/io/redisearch/client/Client.java
@@ -372,6 +372,7 @@ public boolean addDocument(Document doc, AddOptions options) {
public boolean[] addDocuments(Document... docs){
return addDocuments(new AddOptions(), docs);
}
+
/**
* Add a batch of documents to the index
@@ -381,11 +382,13 @@ public boolean[] addDocuments(Document... docs){
*/
@Override
public boolean[] addDocuments(AddOptions options, Document... docs){
+
try (Jedis conn = _conn()) {
+ Pipeline p = conn.pipelined();
for(Document doc : docs) {
- addDocument(doc, options, conn);
+ addDocument(doc, options, p);
}
- List