Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d189325c
提交
d189325c
authored
4月 11, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Re-scale tests so each test takes about 1 second
上级
5e938f6e
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
14 行增加
和
15 行删除
+14
-15
BenchA.java
h2/src/test/org/h2/test/bench/BenchA.java
+3
-3
BenchB.java
h2/src/test/org/h2/test/bench/BenchB.java
+2
-2
BenchC.java
h2/src/test/org/h2/test/bench/BenchC.java
+2
-2
BenchSimple.java
h2/src/test/org/h2/test/bench/BenchSimple.java
+4
-4
test.properties
h2/src/test/org/h2/test/bench/test.properties
+3
-4
没有找到文件。
h2/src/test/org/h2/test/bench/BenchA.java
浏览文件 @
d189325c
...
@@ -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
*
5
0
;
accounts
=
size
*
3
0
;
tellers
=
Math
.
max
(
accounts
/
10
,
1
);
tellers
=
Math
.
max
(
accounts
/
10
,
1
);
branches
=
Math
.
max
(
tellers
/
10
,
1
);
branches
=
Math
.
max
(
tellers
/
10
,
1
);
...
...
h2/src/test/org/h2/test/bench/BenchB.java
浏览文件 @
d189325c
...
@@ -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
();
...
...
h2/src/test/org/h2/test/bench/BenchC.java
浏览文件 @
d189325c
...
@@ -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
);
...
...
h2/src/test/org/h2/test/bench/BenchSimple.java
浏览文件 @
d189325c
...
@@ -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"
);
...
...
h2/src/test/org/h2/test/bench/test.properties
浏览文件 @
d189325c
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
=
4
00
size
=
50
00
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论