|
@@ -2,6 +2,7 @@ package net.officefloor.benchmark;
|
|
|
|
|
|
import java.net.Socket;
|
|
import java.net.Socket;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.BitSet;
|
|
import java.util.BitSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.concurrent.ThreadLocalRandom;
|
|
import java.util.concurrent.ThreadLocalRandom;
|
|
@@ -153,7 +154,7 @@ public class RawSqlClientOfficeFloorMain implements DatabaseOperations {
|
|
// Create connection
|
|
// Create connection
|
|
PgConnectOptions connectOptions = new PgConnectOptions().setHost(server).setPort(port).setDatabase(database)
|
|
PgConnectOptions connectOptions = new PgConnectOptions().setHost(server).setPort(port).setDatabase(database)
|
|
.setUser(username).setPassword(password).setCachePreparedStatements(true).setTcpNoDelay(true)
|
|
.setUser(username).setPassword(password).setCachePreparedStatements(true).setTcpNoDelay(true)
|
|
- .setTcpQuickAck(true);
|
|
|
|
|
|
+ .setTcpQuickAck(true).setPipeliningLimit(1024);
|
|
|
|
|
|
// Provide connection
|
|
// Provide connection
|
|
this.threadLocalQueryExecutor = new ThreadLocal<QueryExecutor>() {
|
|
this.threadLocalQueryExecutor = new ThreadLocal<QueryExecutor>() {
|
|
@@ -278,6 +279,7 @@ public class RawSqlClientOfficeFloorMain implements DatabaseOperations {
|
|
worlds[lastIndex] = new World(row.getInteger(0), ThreadLocalRandom.current().nextInt(1, 10001));
|
|
worlds[lastIndex] = new World(row.getInteger(0), ThreadLocalRandom.current().nextInt(1, 10001));
|
|
}
|
|
}
|
|
if ((lastIndex + 1) >= queryCount) {
|
|
if ((lastIndex + 1) >= queryCount) {
|
|
|
|
+ Arrays.sort(worlds, (a, b) -> a.id - b.id);
|
|
List<Integer> params = new ArrayList<>(queryCount * 2);
|
|
List<Integer> params = new ArrayList<>(queryCount * 2);
|
|
for (int i = 0; i < worlds.length; i++) {
|
|
for (int i = 0; i < worlds.length; i++) {
|
|
World world = worlds[i];
|
|
World world = worlds[i];
|