Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
d287b1b3
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d287b1b3
编写于
7月 12, 2021
作者:
T
tickduan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify intervals default value from 300 to 100
上级
3031aeb9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
24 deletion
+31
-24
deps/SZ/sz/include/ByteToolkit.h
deps/SZ/sz/include/ByteToolkit.h
+1
-1
deps/SZ/sz/include/sz.h
deps/SZ/sz/include/sz.h
+4
-0
deps/SZ/sz/src/DynamicByteArray.c
deps/SZ/sz/src/DynamicByteArray.c
+4
-1
deps/SZ/sz/src/conf.c
deps/SZ/sz/src/conf.c
+2
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+2
-2
src/kit/taospack/taospack.c
src/kit/taospack/taospack.c
+18
-18
未找到文件。
deps/SZ/sz/include/ByteToolkit.h
浏览文件 @
d287b1b3
...
@@ -20,7 +20,7 @@ int bytesToInt_bigEndian(unsigned char* bytes);
...
@@ -20,7 +20,7 @@ int bytesToInt_bigEndian(unsigned char* bytes);
void
intToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
int
num
);
void
intToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
int
num
);
long
bytesToLong_bigEndian
(
unsigned
char
*
b
);
long
bytesToLong_bigEndian
(
unsigned
char
*
b
);
void
longToBytes_bigEndian
(
unsigned
char
*
b
,
unsigned
long
num
);
void
longToBytes_bigEndian
(
unsigned
char
*
b
,
long
num
);
short
getExponent_float
(
float
value
);
short
getExponent_float
(
float
value
);
short
getPrecisionReqLength_float
(
float
precision
);
short
getPrecisionReqLength_float
(
float
precision
);
...
...
deps/SZ/sz/include/sz.h
浏览文件 @
d287b1b3
...
@@ -43,6 +43,10 @@
...
@@ -43,6 +43,10 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
void
cost_start
();
double
cost_end
(
const
char
*
tag
);
void
show_rate
(
int
in_len
,
int
out_len
);
//typedef char int8_t;
//typedef char int8_t;
//typedef unsigned char uint8_t;
//typedef unsigned char uint8_t;
//typedef short int16_t;
//typedef short int16_t;
...
...
deps/SZ/sz/src/DynamicByteArray.c
浏览文件 @
d287b1b3
...
@@ -26,7 +26,10 @@ void convertDBAtoBytes(DynamicByteArray *dba, unsigned char** bytes)
...
@@ -26,7 +26,10 @@ void convertDBAtoBytes(DynamicByteArray *dba, unsigned char** bytes)
if
(
size
>
0
)
if
(
size
>
0
)
*
bytes
=
(
unsigned
char
*
)
malloc
(
size
*
sizeof
(
unsigned
char
));
*
bytes
=
(
unsigned
char
*
)
malloc
(
size
*
sizeof
(
unsigned
char
));
else
else
*
bytes
=
NULL
;
{
*
bytes
=
NULL
;
return
;
}
memcpy
(
*
bytes
,
dba
->
array
,
size
*
sizeof
(
unsigned
char
));
memcpy
(
*
bytes
,
dba
->
array
,
size
*
sizeof
(
unsigned
char
));
}
}
...
...
deps/SZ/sz/src/conf.c
浏览文件 @
d287b1b3
...
@@ -25,8 +25,8 @@ void setDefaulParams(sz_exedata* exedata, sz_params* params)
...
@@ -25,8 +25,8 @@ void setDefaulParams(sz_exedata* exedata, sz_params* params)
params
->
errorBoundMode
=
SZ_ABS
;
params
->
errorBoundMode
=
SZ_ABS
;
params
->
absErrBound
=
1E-8
;
params
->
absErrBound
=
1E-8
;
params
->
absErrBoundDouble
=
1E-16
;
params
->
absErrBoundDouble
=
1E-16
;
params
->
max_quant_intervals
=
8
00
;
params
->
max_quant_intervals
=
5
00
;
params
->
quantization_intervals
=
5
00
;
params
->
quantization_intervals
=
1
00
;
params
->
losslessCompressor
=
ZSTD_COMPRESSOR
;
//other option: GZIP_COMPRESSOR;
params
->
losslessCompressor
=
ZSTD_COMPRESSOR
;
//other option: GZIP_COMPRESSOR;
// second important
// second important
...
...
src/common/src/tglobal.c
浏览文件 @
d287b1b3
...
@@ -251,8 +251,8 @@ char lossyColumns[32] = ""; // "float|double" means all float and double column
...
@@ -251,8 +251,8 @@ char lossyColumns[32] = ""; // "float|double" means all float and double column
// below option can take effect when tsLossyColumns not empty
// below option can take effect when tsLossyColumns not empty
double
fPrecision
=
1E-8
;
// float column precision
double
fPrecision
=
1E-8
;
// float column precision
double
dPrecision
=
1E-16
;
// double column precision
double
dPrecision
=
1E-16
;
// double column precision
uint32_t
maxIntervals
=
8
00
;
// max intervals
uint32_t
maxIntervals
=
5
00
;
// max intervals
uint32_t
intervals
=
5
00
;
// intervals
uint32_t
intervals
=
1
00
;
// intervals
char
Compressor
[
32
]
=
"ZSTD_COMPRESSOR"
;
// ZSTD_COMPRESSOR or GZIP_COMPRESSOR
char
Compressor
[
32
]
=
"ZSTD_COMPRESSOR"
;
// ZSTD_COMPRESSOR or GZIP_COMPRESSOR
...
...
src/kit/taospack/taospack.c
浏览文件 @
d287b1b3
...
@@ -137,6 +137,8 @@ float* read_float(const char* inFile, int* pcount){
...
@@ -137,6 +137,8 @@ float* read_float(const char* inFile, int* pcount){
int
fi
=
0
;
int
fi
=
0
;
while
(
fgets
(
buf
,
sizeof
(
buf
),
pfin
)
!=
NULL
)
{
while
(
fgets
(
buf
,
sizeof
(
buf
),
pfin
)
!=
NULL
)
{
// get item
// get item
if
(
buf
[
0
]
==
0
||
strcmp
(
buf
,
" "
)
==
0
)
continue
;
floats
[
fi
]
=
atof
(
buf
);
floats
[
fi
]
=
atof
(
buf
);
//printf(" buff=%s float=%.50f \n ", buf, floats[fi]);
//printf(" buff=%s float=%.50f \n ", buf, floats[fi]);
if
(
++
fi
==
malloc_cnt
)
{
if
(
++
fi
==
malloc_cnt
)
{
...
@@ -257,7 +259,7 @@ bool DoDouble(double* doubles, int cnt, int algorithm) {
...
@@ -257,7 +259,7 @@ bool DoDouble(double* doubles, int cnt, int algorithm) {
return
true
;
return
true
;
}
}
bool
DoFloat
(
float
*
floats
,
int
cnt
,
int
algorithm
)
{
bool
DoFloat
(
float
*
floats
,
int
cnt
,
int
algorithm
,
bool
lossy
)
{
// compress
// compress
const
char
*
input
=
(
const
char
*
)
floats
;
const
char
*
input
=
(
const
char
*
)
floats
;
int
input_len
=
cnt
*
sizeof
(
float
);
int
input_len
=
cnt
*
sizeof
(
float
);
...
@@ -268,11 +270,8 @@ bool DoFloat(float* floats, int cnt, int algorithm) {
...
@@ -268,11 +270,8 @@ bool DoFloat(float* floats, int cnt, int algorithm) {
cost_start
();
cost_start
();
int
ret_len
=
0
;
int
ret_len
=
0
;
if
(
algorithm
==
2
)
ret_len
=
tsCompressFloat
(
input
,
input_len
,
cnt
,
output
,
output_len
,
algorithm
,
buff
,
buff_len
);
ret_len
=
tsCompressFloat
(
input
,
input_len
,
cnt
,
output
,
output_len
,
algorithm
,
buff
,
buff_len
);
else
ret_len
=
tsCompressFloatLossy
(
input
,
input_len
,
cnt
,
output
,
output_len
,
algorithm
,
buff
,
buff_len
);
if
(
ret_len
==
-
1
)
{
if
(
ret_len
==
-
1
)
{
printf
(
" compress error.
\n
"
);
printf
(
" compress error.
\n
"
);
return
0
;
return
0
;
...
@@ -289,20 +288,15 @@ bool DoFloat(float* floats, int cnt, int algorithm) {
...
@@ -289,20 +288,15 @@ bool DoFloat(float* floats, int cnt, int algorithm) {
float
*
ft2
=
(
float
*
)
malloc
(
input_len
);
float
*
ft2
=
(
float
*
)
malloc
(
input_len
);
cost_start
();
cost_start
();
int
code
=
0
;
int
code
=
0
;
code
=
tsDecompressFloat
(
output
,
ret_len
,
cnt
,
(
char
*
)
ft2
,
input_len
,
algorithm
,
buff
,
buff_len
);
if
(
algorithm
==
2
)
code
=
tsDecompressFloat
(
output
,
ret_len
,
cnt
,
(
char
*
)
ft2
,
input_len
,
algorithm
,
buff
,
buff_len
);
else
code
=
tsDecompressFloatLossy
(
output
,
ret_len
,
cnt
,
(
char
*
)
ft2
,
input_len
,
algorithm
,
buff
,
buff_len
);
double
use_ms2
=
cost_end
(
"Decompress"
);
double
use_ms2
=
cost_end
(
"Decompress"
);
printf
(
" Decompress return length=%d
\n
"
,
code
);
printf
(
" Decompress return length=%d
\n
"
,
code
);
// compare same
// compare same
float
same_rate
=
check_same
(
floats
,
ft2
,
cnt
);
float
same_rate
=
check_same
(
floats
,
ft2
,
cnt
);
printf
(
"
\n
------------------ count:%d <%s> ----------------
\n
"
,
cnt
,
algorithm
==
2
?
"TD"
:
"SZ
"
);
printf
(
"
\n
------------------ count:%d <%s> ----------------
\n
"
,
cnt
,
lossy
?
"SZ"
:
"TD
"
);
printf
(
" Compress Rate ......... [%.2f%%]
\n
"
,
rate
);
printf
(
" Compress Rate ......... [%.2f%%]
\n
"
,
rate
);
double
speed1
=
(
cnt
*
sizeof
(
float
)
*
1000
/
1024
/
1024
)
/
use_ms1
;
double
speed1
=
(
cnt
*
sizeof
(
float
)
*
1000
/
1024
/
1024
)
/
use_ms1
;
printf
(
" Compress Time ......... [%.4fms] speed=%.1f MB/s
\n
"
,
use_ms1
,
speed1
);
printf
(
" Compress Time ......... [%.4fms] speed=%.1f MB/s
\n
"
,
use_ms1
,
speed1
);
...
@@ -320,7 +314,7 @@ bool DoFloat(float* floats, int cnt, int algorithm) {
...
@@ -320,7 +314,7 @@ bool DoFloat(float* floats, int cnt, int algorithm) {
}
}
bool
testFile
(
const
char
*
inFile
,
char
algorithm
){
bool
testFile
(
const
char
*
inFile
,
char
algorithm
,
bool
lossy
){
// check valid
// check valid
if
(
inFile
==
NULL
||
inFile
[
0
]
==
0
){
if
(
inFile
==
NULL
||
inFile
[
0
]
==
0
){
printf
(
" inFile is NULL or EMPTY.
\n
"
);
printf
(
" inFile is NULL or EMPTY.
\n
"
);
...
@@ -333,7 +327,7 @@ bool testFile(const char* inFile, char algorithm){
...
@@ -333,7 +327,7 @@ bool testFile(const char* inFile, char algorithm){
return
false
;
return
false
;
}
}
DoFloat
(
floats
,
cnt
,
algorithm
);
DoFloat
(
floats
,
cnt
,
algorithm
,
lossy
);
free
(
floats
);
free
(
floats
);
return
true
;
return
true
;
...
@@ -688,10 +682,15 @@ extern bool lossyFloat;
...
@@ -688,10 +682,15 @@ extern bool lossyFloat;
//
//
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"welcome to use taospack tools v1.3
\n
"
);
printf
(
"welcome to use taospack tools v1.3
\n
"
);
printf
(
" sizeof(int)=%d
\n
"
,
(
int
)
sizeof
(
int
));
printf
(
" sizeof(long)=%d
\n
"
,
(
int
)
sizeof
(
long
));
printf
(
" sizeof(short)=%d
\n
"
,(
int
)
sizeof
(
short
));
strcpy
(
lossyColumns
,
"float|double"
);
strcpy
(
lossyColumns
,
"float|double"
);
bool
lossy
=
true
;
tsCompressInit
();
tsCompressInit
();
//
lossyFloat = lossyDouble = true;
lossyFloat
=
lossyDouble
=
true
;
//
//
//tsCompressExit();
//tsCompressExit();
...
@@ -707,6 +706,7 @@ int main(int argc, char *argv[]) {
...
@@ -707,6 +706,7 @@ int main(int argc, char *argv[]) {
}
}
if
(
strcmp
(
argv
[
1
],
"-tw"
)
==
0
)
{
if
(
strcmp
(
argv
[
1
],
"-tw"
)
==
0
)
{
algo
=
TWO_STAGE_COMP
;
algo
=
TWO_STAGE_COMP
;
lossy
=
false
;
lossyFloat
=
lossyDouble
=
false
;
lossyFloat
=
lossyDouble
=
false
;
}
}
...
@@ -730,7 +730,7 @@ int main(int argc, char *argv[]) {
...
@@ -730,7 +730,7 @@ int main(int argc, char *argv[]) {
return
0
;
return
0
;
}
}
bool
ret
=
testFile
(
argv
[
2
],
algo
);
bool
ret
=
testFile
(
argv
[
2
],
algo
,
lossy
);
printf
(
" test file %s.
\n
"
,
ret
?
"ok"
:
"err"
);
printf
(
" test file %s.
\n
"
,
ret
?
"ok"
:
"err"
);
return
1
;
return
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录