Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
43bc021e
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
43bc021e
编写于
1月 03, 2023
作者:
S
Shengliang Guan
提交者:
GitHub
1月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #19312 from taosdata/feature/3_liaohj
refactor: disable all asserts.
上级
d33bcc99
879205eb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
28 deletion
+89
-28
cmake/cmake.define
cmake/cmake.define
+8
-2
include/util/tlog.h
include/util/tlog.h
+7
-0
source/util/src/tcompression.c
source/util/src/tcompression.c
+74
-26
未找到文件。
cmake/cmake.define
浏览文件 @
43bc021e
...
@@ -117,12 +117,18 @@ ELSE ()
...
@@ -117,12 +117,18 @@ ELSE ()
IF (${BUILD_SANITIZER})
IF (${BUILD_SANITIZER})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -fsanitize=address -fsanitize=undefined -fsanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=shift-base -fno-sanitize=alignment -g3 -Wformat=0")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -fsanitize=address -fsanitize=undefined -fsanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=shift-base -fno-sanitize=alignment -g3 -Wformat=0")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -fsanitize=address -fsanitize=undefined -fsanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=shift-base -fno-sanitize=alignment -g3 -Wformat=0")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -fsanitize=address -fsanitize=undefined -fsanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=shift-base -fno-sanitize=alignment -g3 -Wformat=0")
MESSAGE(STATUS "
Will c
ompile with Address Sanitizer!")
MESSAGE(STATUS "
C
ompile with Address Sanitizer!")
ELSE ()
ELSE ()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k")
ENDIF ()
ENDIF ()
# disable all assert
IF ((${DISABLE_ASSERT} MATCHES "true") OR (${DISABLE_ASSERTS} MATCHES "true"))
ADD_DEFINITIONS(-DDISABLE_ASSERT)
MESSAGE(STATUS "Disable all asserts")
ENDIF()
INCLUDE(CheckCCompilerFlag)
INCLUDE(CheckCCompilerFlag)
IF (TD_ARM_64 OR TD_ARM_32)
IF (TD_ARM_64 OR TD_ARM_32)
SET(COMPILER_SUPPORT_SSE42 false)
SET(COMPILER_SUPPORT_SSE42 false)
...
@@ -155,7 +161,7 @@ ELSE ()
...
@@ -155,7 +161,7 @@ ELSE ()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
ENDIF()
ENDIF()
MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED")
MESSAGE(STATUS "SIMD instructions (
FMA/
AVX/AVX2) is ACTIVATED")
ENDIF()
ENDIF()
ENDIF ()
ENDIF ()
include/util/tlog.h
浏览文件 @
43bc021e
...
@@ -85,12 +85,19 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
...
@@ -85,12 +85,19 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
bool
taosAssertDebug
(
bool
condition
,
const
char
*
file
,
int32_t
line
,
const
char
*
format
,
...);
bool
taosAssertDebug
(
bool
condition
,
const
char
*
file
,
int32_t
line
,
const
char
*
format
,
...);
bool
taosAssertRelease
(
bool
condition
);
bool
taosAssertRelease
(
bool
condition
);
// Disable all asserts that may compromise the performance.
#if defined DISABLE_ASSERT
#define ASSERT(condition)
#define ASSERTS(condition, ...)
#else
#define ASSERTS(condition, ...) taosAssertDebug(condition, __FILE__, __LINE__, __VA_ARGS__)
#define ASSERTS(condition, ...) taosAssertDebug(condition, __FILE__, __LINE__, __VA_ARGS__)
#ifdef NDEBUG
#ifdef NDEBUG
#define ASSERT(condition) taosAssertRelease(condition)
#define ASSERT(condition) taosAssertRelease(condition)
#else
#else
#define ASSERT(condition) taosAssertDebug(condition, __FILE__, __LINE__, "assert info not provided")
#define ASSERT(condition) taosAssertDebug(condition, __FILE__, __LINE__, "assert info not provided")
#endif
#endif
#endif
// clang-format off
// clang-format off
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
...
...
source/util/src/tcompression.c
浏览文件 @
43bc021e
...
@@ -273,42 +273,90 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha
...
@@ -273,42 +273,90 @@ int32_t tsDecompressINTImp(const char *const input, const int32_t nelements, cha
char
bit
=
bit_per_integer
[(
int32_t
)
selector
];
// bit = 3
char
bit
=
bit_per_integer
[(
int32_t
)
selector
];
// bit = 3
int32_t
elems
=
selector_to_elems
[(
int32_t
)
selector
];
int32_t
elems
=
selector_to_elems
[(
int32_t
)
selector
];
for
(
int32_t
i
=
0
;
i
<
elems
;
i
++
)
{
// Optimize the performance, by remove the constantly switch operation.
uint64_t
zigzag_value
;
int32_t
v
=
0
;
uint64_t
zigzag_value
;
switch
(
type
)
{
case
TSDB_DATA_TYPE_BIGINT
:
{
for
(
int32_t
i
=
0
;
i
<
elems
;
i
++
)
{
if
(
selector
==
0
||
selector
==
1
)
{
zigzag_value
=
0
;
}
else
{
zigzag_value
=
((
w
>>
(
4
+
v
))
&
INT64MASK
(
bit
));
}
if
(
selector
==
0
||
selector
==
1
)
{
int64_t
diff
=
ZIGZAG_DECODE
(
int64_t
,
zigzag_value
);
zigzag_value
=
0
;
int64_t
curr_value
=
diff
+
prev_value
;
}
else
{
prev_value
=
curr_value
;
zigzag_value
=
((
w
>>
(
4
+
bit
*
i
))
&
INT64MASK
(
bit
));
}
int64_t
diff
=
ZIGZAG_DECODE
(
int64_t
,
zigzag_value
);
int64_t
curr_value
=
diff
+
prev_value
;
prev_value
=
curr_value
;
switch
(
type
)
{
case
TSDB_DATA_TYPE_BIGINT
:
*
((
int64_t
*
)
output
+
_pos
)
=
(
int64_t
)
curr_value
;
*
((
int64_t
*
)
output
+
_pos
)
=
(
int64_t
)
curr_value
;
_pos
++
;
_pos
++
;
break
;
case
TSDB_DATA_TYPE_INT
:
v
+=
bit
;
if
((
++
count
)
==
nelements
)
break
;
}
}
break
;
case
TSDB_DATA_TYPE_INT
:
{
for
(
int32_t
i
=
0
;
i
<
elems
;
i
++
)
{
if
(
selector
==
0
||
selector
==
1
)
{
zigzag_value
=
0
;
}
else
{
zigzag_value
=
((
w
>>
(
4
+
v
))
&
INT64MASK
(
bit
));
}
int64_t
diff
=
ZIGZAG_DECODE
(
int64_t
,
zigzag_value
);
int64_t
curr_value
=
diff
+
prev_value
;
prev_value
=
curr_value
;
*
((
int32_t
*
)
output
+
_pos
)
=
(
int32_t
)
curr_value
;
*
((
int32_t
*
)
output
+
_pos
)
=
(
int32_t
)
curr_value
;
_pos
++
;
_pos
++
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
v
+=
bit
;
if
((
++
count
)
==
nelements
)
break
;
}
}
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
{
for
(
int32_t
i
=
0
;
i
<
elems
;
i
++
)
{
if
(
selector
==
0
||
selector
==
1
)
{
zigzag_value
=
0
;
}
else
{
zigzag_value
=
((
w
>>
(
4
+
v
))
&
INT64MASK
(
bit
));
}
int64_t
diff
=
ZIGZAG_DECODE
(
int64_t
,
zigzag_value
);
int64_t
curr_value
=
diff
+
prev_value
;
prev_value
=
curr_value
;
*
((
int16_t
*
)
output
+
_pos
)
=
(
int16_t
)
curr_value
;
*
((
int16_t
*
)
output
+
_pos
)
=
(
int16_t
)
curr_value
;
_pos
++
;
_pos
++
;
break
;
case
TSDB_DATA_TYPE_TINYINT
:
v
+=
bit
;
if
((
++
count
)
==
nelements
)
break
;
}
}
break
;
case
TSDB_DATA_TYPE_TINYINT
:
{
for
(
int32_t
i
=
0
;
i
<
elems
;
i
++
)
{
if
(
selector
==
0
||
selector
==
1
)
{
zigzag_value
=
0
;
}
else
{
zigzag_value
=
((
w
>>
(
4
+
v
))
&
INT64MASK
(
bit
));
}
int64_t
diff
=
ZIGZAG_DECODE
(
int64_t
,
zigzag_value
);
int64_t
curr_value
=
diff
+
prev_value
;
prev_value
=
curr_value
;
*
((
int8_t
*
)
output
+
_pos
)
=
(
int8_t
)
curr_value
;
*
((
int8_t
*
)
output
+
_pos
)
=
(
int8_t
)
curr_value
;
_pos
++
;
_pos
++
;
break
;
default:
v
+=
bit
;
perror
(
"Wrong integer types.
\n
"
);
if
((
++
count
)
==
nelements
)
break
;
return
-
1
;
}
}
}
break
;
count
++
;
if
(
count
==
nelements
)
break
;
}
}
ip
+=
LONG_BYTES
;
ip
+=
LONG_BYTES
;
}
}
...
@@ -758,7 +806,7 @@ int32_t tsDecompressDoubleImp(const char *const input, const int32_t nelements,
...
@@ -758,7 +806,7 @@ int32_t tsDecompressDoubleImp(const char *const input, const int32_t nelements,
uint64_t
prev_value
=
0
;
uint64_t
prev_value
=
0
;
for
(
int32_t
i
=
0
;
i
<
nelements
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
nelements
;
i
++
)
{
if
(
i
%
2
==
0
)
{
if
(
(
i
&
0x01
)
==
0
)
{
flags
=
input
[
ipos
++
];
flags
=
input
[
ipos
++
];
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录