Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
96aa7058
提交
96aa7058
authored
11 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bugfix (fix performance degradation)
上级
88b00aa0
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
25 行增加
和
14 行删除
+25
-14
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+11
-6
TestMVStoreBenchmark.java
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
+14
-8
没有找到文件。
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
96aa7058
...
...
@@ -267,8 +267,13 @@ public class MVStore {
*/
MVStore
(
HashMap
<
String
,
Object
>
config
)
{
this
.
compress
=
config
.
containsKey
(
"compress"
);
String
fileName
=
(
String
)
config
.
get
(
"fileName"
);
Object
o
=
config
.
get
(
"pageSplitSize"
);
pageSplitSize
=
o
==
null
?
16
*
1024
:
(
Integer
)
o
;
if
(
o
==
null
)
{
pageSplitSize
=
fileName
==
null
?
4
*
1024
:
16
*
1024
;
}
else
{
pageSplitSize
=
(
Integer
)
o
;
}
o
=
config
.
get
(
"backgroundExceptionHandler"
);
this
.
backgroundExceptionHandler
=
(
UncaughtExceptionHandler
)
o
;
meta
=
new
MVMapConcurrent
<
String
,
String
>(
StringDataType
.
INSTANCE
,
...
...
@@ -278,7 +283,6 @@ public class MVStore {
c
.
put
(
"createVersion"
,
Long
.
toString
(
currentVersion
));
meta
.
init
(
this
,
c
);
fileStore
=
(
FileStore
)
config
.
get
(
"fileStore"
);
String
fileName
=
(
String
)
config
.
get
(
"fileName"
);
if
(
fileName
==
null
&&
fileStore
==
null
)
{
cache
=
null
;
return
;
...
...
@@ -2158,9 +2162,10 @@ public class MVStore {
/**
* Set the amount of memory a page should contain at most, in bytes,
* before it is split. The default is 16 KB. This is not a limit in the
* page size, as pages with one entry can get larger. It is just the
* point where pages that contain more than one entry are split.
* before it is split. The default is 16 KB for persistent stores and 4
* KB for in-memory stores. This is not a limit in the page size, as
* pages with one entry can get larger. It is just the point where pages
* that contain more than one entry are split.
*
* @param pageSplitSize the page size
* @return this
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
浏览文件 @
96aa7058
...
...
@@ -147,14 +147,20 @@ public class TestMVStoreBenchmark extends TestBase {
return
;
}
int
size
=
1000000
;
long
hash
=
0
,
tree
=
0
,
mv
=
0
;
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Map
<
Integer
,
String
>
map
;
map
=
new
HashMap
<
Integer
,
String
>(
size
);
long
hash
=
testPerformance
(
map
,
size
);
hash
=
testPerformance
(
map
,
size
);
map
=
new
TreeMap
<
Integer
,
String
>();
long
tree
=
testPerformance
(
map
,
size
);
tree
=
testPerformance
(
map
,
size
);
MVStore
store
=
MVStore
.
open
(
null
);
map
=
store
.
openMap
(
"test"
);
long
mv
=
testPerformance
(
map
,
size
);
mv
=
testPerformance
(
map
,
size
);
if
(
hash
<
tree
&&
mv
<
tree
)
{
break
;
}
}
String
msg
=
"mv "
+
mv
+
" tree "
+
tree
+
" hash "
+
hash
;
assertTrue
(
msg
,
hash
<
tree
);
// assertTrue(msg, hash < mv);
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论