提交 d189325c authored 作者: Thomas Mueller's avatar Thomas Mueller

Re-scale tests so each test takes about 1 second

上级 5e938f6e
...@@ -32,10 +32,10 @@ public class BenchA implements Bench { ...@@ -32,10 +32,10 @@ public class BenchA implements Bench {
@Override @Override
public void init(Database db, int size) throws SQLException { public void init(Database db, int size) throws SQLException {
this.database = db; this.database = db;
transactions = size * 30; transactions = size * 6;
int scale = 1; int scale = 2;
accounts = size * 50; accounts = size * 30;
tellers = Math.max(accounts / 10, 1); tellers = Math.max(accounts / 10, 1);
branches = Math.max(tellers / 10, 1); branches = Math.max(tellers / 10, 1);
......
...@@ -21,7 +21,7 @@ import java.util.Random; ...@@ -21,7 +21,7 @@ import java.util.Random;
*/ */
public class BenchB implements Bench, Runnable { public class BenchB implements Bench, Runnable {
private static final int SCALE = 1; private static final int SCALE = 4;
private static final int BRANCHES = 1; private static final int BRANCHES = 1;
private static final int TELLERS = 10; private static final int TELLERS = 10;
private static final int ACCOUNTS = 100000; private static final int ACCOUNTS = 100000;
...@@ -66,7 +66,7 @@ public class BenchB implements Bench, Runnable { ...@@ -66,7 +66,7 @@ public class BenchB implements Bench, Runnable {
@Override @Override
public void init(Database db, int size) throws SQLException { public void init(Database db, int size) throws SQLException {
this.database = db; this.database = db;
this.transactionPerClient = size; this.transactionPerClient = size / 8;
db.start(this, "Init"); db.start(this, "Init");
db.openConnection(); db.openConnection();
......
...@@ -168,7 +168,7 @@ public class BenchC implements Bench { ...@@ -168,7 +168,7 @@ public class BenchC implements Bench {
" SUCCESSFUL INT,\n" + " SUCCESSFUL INT,\n" +
" NOW TIMESTAMP)" }; " NOW TIMESTAMP)" };
int warehouses = 1; int warehouses = 2;
int items = 10000; int items = 10000;
int districtsPerWarehouse = 10; int districtsPerWarehouse = 10;
int customersPerDistrict = 300; int customersPerDistrict = 300;
...@@ -187,7 +187,7 @@ public class BenchC implements Bench { ...@@ -187,7 +187,7 @@ public class BenchC implements Bench {
random = new BenchCRandom(); random = new BenchCRandom();
items = size * 10; items = size * 10;
warehouses = 1; warehouses = 2;
districtsPerWarehouse = Math.max(1, size / 100); districtsPerWarehouse = Math.max(1, size / 100);
customersPerDistrict = Math.max(1, size / 100); customersPerDistrict = Math.max(1, size / 100);
ordersPerDistrict = Math.max(1, size / 1000); ordersPerDistrict = Math.max(1, size / 1000);
......
...@@ -23,7 +23,7 @@ public class BenchSimple implements Bench { ...@@ -23,7 +23,7 @@ public class BenchSimple implements Bench {
@Override @Override
public void init(Database db, int size) throws SQLException { public void init(Database db, int size) throws SQLException {
this.database = db; this.database = db;
this.records = size * 60; this.records = size * 75;
db.start(this, "Init"); db.start(this, "Init");
db.openConnection(); db.openConnection();
...@@ -62,7 +62,7 @@ public class BenchSimple implements Bench { ...@@ -62,7 +62,7 @@ public class BenchSimple implements Bench {
db.start(this, "Query (random)"); db.start(this, "Query (random)");
prep = db.prepare("SELECT * FROM TEST WHERE ID=?"); prep = db.prepare("SELECT * FROM TEST WHERE ID=?");
for (int i = 0; i < records; i++) { for (int i = 0; i < records / 10; i++) {
prep.setInt(1, random.nextInt(records)); prep.setInt(1, random.nextInt(records));
db.queryReadResult(prep); db.queryReadResult(prep);
} }
...@@ -76,9 +76,9 @@ public class BenchSimple implements Bench { ...@@ -76,9 +76,9 @@ public class BenchSimple implements Bench {
} }
db.end(); db.end();
db.start(this, "Update (random)"); db.start(this, "Update (sequential)");
prep = db.prepare("UPDATE TEST SET NAME=? WHERE ID=?"); prep = db.prepare("UPDATE TEST SET NAME=? WHERE ID=?");
for (int i = 0; i < records; i++) { for (int i = 0; i < records; i += 3) {
prep.setString(1, "Hallo Welt"); prep.setString(1, "Hallo Welt");
prep.setInt(2, i); prep.setInt(2, i);
db.update(prep, "updateTest"); db.update(prep, "updateTest");
......
db1 = H2 (MVStore), org.h2.Driver, jdbc:h2:./data/test;MV_STORE=TRUE, sa, sa db1 = H2, org.h2.Driver, jdbc:h2:./data/test, sa, sa
db9 = H2 (PageStore), org.h2.Driver, jdbc:h2:./data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#xdb1 = H2, org.h2.Driver, jdbc:h2:./data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine, sa, sa #xdb1 = H2, org.h2.Driver, jdbc:h2:./data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine, sa, sa
...@@ -15,7 +14,7 @@ db9 = H2 (PageStore), org.h2.Driver, jdbc:h2:./data/test;LOCK_TIMEOUT=10000;LOCK ...@@ -15,7 +14,7 @@ db9 = H2 (PageStore), org.h2.Driver, jdbc:h2:./data/test;LOCK_TIMEOUT=10000;LOCK
db2 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:data/test;hsqldb.default_table_type=cached;sql.enforce_size=true, sa db2 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:data/test;hsqldb.default_table_type=cached;sql.enforce_size=true, sa
db3 = Derby, org.apache.derby.jdbc.EmbeddedDriver, jdbc:derby:data/derby;create=true, sa, sa db3 = Derby, org.apache.derby.jdbc.EmbeddedDriver, jdbc:derby:data/derby;create=true, sa, sa
db4 = H2 (Server), org.h2.Driver, jdbc:h2:tcp://localhost/data/testServer;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa db4 = H2 (Server), org.h2.Driver, jdbc:h2:tcp://localhost/./data/testServer, sa, sa
db5 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:hsql://localhost/xdb, sa db5 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:hsql://localhost/xdb, sa
db6 = Derby, org.apache.derby.jdbc.ClientDriver, jdbc:derby://localhost/data/derbyServer;create=true, sa, sa db6 = Derby, org.apache.derby.jdbc.ClientDriver, jdbc:derby://localhost/data/derbyServer;create=true, sa, sa
db7 = PostgreSQL, org.postgresql.Driver, jdbc:postgresql:test, sa, sa db7 = PostgreSQL, org.postgresql.Driver, jdbc:postgresql:test, sa, sa
...@@ -37,4 +36,4 @@ test2 = org.h2.test.bench.BenchA ...@@ -37,4 +36,4 @@ test2 = org.h2.test.bench.BenchA
test3 = org.h2.test.bench.BenchB test3 = org.h2.test.bench.BenchB
test4 = org.h2.test.bench.BenchC test4 = org.h2.test.bench.BenchC
size = 400 size = 5000
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论