forked from bytedance/sonic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt: reduce memory pool size (bytedance#302)
* fix: reduce state stack size * fix types * opt: shrink encoder stack size * opt: reduce decoder stack size * add bench.py loops Co-authored-by: liuqiang <[email protected]> Co-authored-by: duanyi.aster <[email protected]>
- Loading branch information
1 parent
3e6f839
commit 6deed01
Showing
12 changed files
with
82 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
#ifndef TYPES_H | ||
#define TYPES_H | ||
|
||
// !NOT MODIFIED ONLY. | ||
// This definitions are copied from internal/native/types/types.go. | ||
|
||
#define V_EOF 1 | ||
#define V_NULL 2 | ||
#define V_TRUE 3 | ||
#define V_FALSE 4 | ||
#define V_ARRAY 5 | ||
#define V_OBJECT 6 | ||
#define V_STRING 7 | ||
#define V_DOUBLE 8 | ||
#define V_INTEGER 9 | ||
#define V_KEY_SEP 10 | ||
#define V_ELEM_SEP 11 | ||
#define V_ARRAY_END 12 | ||
#define V_OBJECT_END 13 | ||
|
||
#define F_DBLUNQ (1 << 0) | ||
#define F_UNIREP (1 << 1) | ||
|
||
#define VS_NULL 0x6c6c756e // 'null' in little endian | ||
#define VS_TRUE 0x65757274 // 'true' in little endian | ||
#define VS_ALSE 0x65736c61 // 'alse' in little endian ('false' without the 'f') | ||
|
||
#define ERR_EOF 1 | ||
#define ERR_INVAL 2 | ||
#define ERR_ESCAPE 3 | ||
#define ERR_UNICODE 4 | ||
#define ERR_OVERFLOW 5 | ||
#define ERR_NUMBER_FMT 6 | ||
#define ERR_RECURSE_MAX 7 | ||
#define ERR_FLOAT_INF 8 | ||
|
||
#define MAX_RECURSE 4096 | ||
|
||
#endif |