Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
64549702
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
64549702
编写于
12月 06, 2020
作者:
M
Maksim Kita
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DragonBox integration
上级
67c82eb6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
18 addition
and
4 deletion
+18
-4
.gitmodules
.gitmodules
+3
-0
contrib/CMakeLists.txt
contrib/CMakeLists.txt
+2
-0
contrib/dragonbox
contrib/dragonbox
+1
-0
docker/test/fasttest/run.sh
docker/test/fasttest/run.sh
+1
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-0
src/IO/WriteHelpers.h
src/IO/WriteHelpers.h
+3
-3
src/IO/tests/CMakeLists.txt
src/IO/tests/CMakeLists.txt
+1
-0
src/IO/tests/ryu_test.cpp
src/IO/tests/ryu_test.cpp
+6
-1
未找到文件。
.gitmodules
浏览文件 @
64549702
...
...
@@ -209,3 +209,6 @@
path = contrib/abseil-cpp
url = https://github.com/ClickHouse-Extras/abseil-cpp.git
branch = lts_2020_02_25
[submodule "contrib/dragonbox"]
path = contrib/dragonbox
url = https://github.com/kitaisreal/dragonbox.git
contrib/CMakeLists.txt
浏览文件 @
64549702
...
...
@@ -322,3 +322,5 @@ endif()
if
(
USE_INTERNAL_ROCKSDB_LIBRARY
)
add_subdirectory
(
rocksdb-cmake
)
endif
()
add_subdirectory
(
dragonbox
)
\ No newline at end of file
dragonbox
@
17d07b00
Subproject commit 17d07b00f9c70d61c60c3bd1046c2ef6814d14c6
docker/test/fasttest/run.sh
浏览文件 @
64549702
...
...
@@ -155,6 +155,7 @@ function clone_submodules
contrib/croaring
contrib/miniselect
contrib/xz
contrib/dragonbox
)
git submodule
sync
...
...
src/CMakeLists.txt
浏览文件 @
64549702
...
...
@@ -243,6 +243,7 @@ target_link_libraries (clickhouse_common_io
common
${
DOUBLE_CONVERSION_LIBRARIES
}
ryu
dragonbox_to_chars
)
if
(
RE2_LIBRARY
)
...
...
src/IO/WriteHelpers.h
浏览文件 @
64549702
...
...
@@ -29,7 +29,7 @@
#include <IO/DoubleConverter.h>
#include <IO/WriteBufferFromString.h>
#include <
ryu/ryu
.h>
#include <
dragonbox/dragonbox_to_chars
.h>
#include <Formats/FormatSettings.h>
...
...
@@ -228,14 +228,14 @@ inline size_t writeFloatTextFastPath(T x, char * buffer)
if
(
DecomposedFloat64
(
x
).
is_inside_int64
())
result
=
itoa
(
Int64
(
x
),
buffer
)
-
buffer
;
else
result
=
d2s_buffered_n
(
x
,
buffer
)
;
result
=
jkj
::
dragonbox
::
to_chars_n
(
x
,
buffer
)
-
buffer
;
}
else
{
if
(
DecomposedFloat32
(
x
).
is_inside_int32
())
result
=
itoa
(
Int32
(
x
),
buffer
)
-
buffer
;
else
result
=
f2s_buffered_n
(
x
,
buffer
)
;
result
=
jkj
::
dragonbox
::
to_chars_n
(
x
,
buffer
)
-
buffer
;
}
if
(
result
<=
0
)
...
...
src/IO/tests/CMakeLists.txt
浏览文件 @
64549702
...
...
@@ -82,6 +82,7 @@ target_link_libraries (zlib_ng_bug PRIVATE ${ZLIB_LIBRARIES})
add_executable
(
ryu_test ryu_test.cpp
)
target_link_libraries
(
ryu_test PRIVATE ryu
)
target_link_libraries
(
ryu_test PRIVATE dragonbox_to_chars
)
add_executable
(
zstd_buffers zstd_buffers.cpp
)
target_link_libraries
(
zstd_buffers PRIVATE clickhouse_common_io
)
src/IO/tests/ryu_test.cpp
浏览文件 @
64549702
...
...
@@ -2,7 +2,7 @@
#include <iostream>
#include <cstring>
#include <ryu/ryu.h>
#include <dragonbox/dragonbox_to_chars.h>
struct
DecomposedFloat64
{
...
...
@@ -84,9 +84,14 @@ int main(int argc, char ** argv)
double
x
=
argc
>
1
?
std
::
stod
(
argv
[
1
])
:
0
;
char
buf
[
32
];
std
::
cout
<<
"ryu output"
<<
std
::
endl
;
d2s_buffered
(
x
,
buf
);
std
::
cout
<<
buf
<<
"
\n
"
;
std
::
cout
<<
"dragonbox output"
<<
std
::
endl
;
jkj
::
dragonbox
::
to_chars
(
x
,
buf
);
std
::
cout
<<
buf
<<
"
\n
"
;
std
::
cout
<<
DecomposedFloat64
(
x
).
isInsideInt64
()
<<
"
\n
"
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录