2
0
Fork 0
mirror of https://github.com/ii64/sonic.git synced 2026-06-21 00:46:43 +08:00
Commit graph

92 commits

Author SHA1 Message Date
liu
bf4e9e1982
fix: check number ending in skip number (#179)
* fix: check number ending in skip number

* build: clang12

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-01-25 15:21:00 +08:00
Yi Duan
3dde76677e
doc: update benchmarks and dependency repos (#180)
* doc: update benchmarks and dependency repos

* doc: add 'Optimization Options' on README

* fix some possible typos

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-01-25 15:09:01 +08:00
Yi Duan
f8efc2f6e7
Update README.md (#173) 2022-01-18 14:27:19 +08:00
liu
d75ce3f730
opt: use simd to optimize htmlescape (#171)
* opt: use simd to optimize htmlescape

* opt: reuse escaped buffer

* feat: cmake with Clang12

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-01-18 11:30:28 +08:00
Yi Duan
14121d64f1
feat:(encoder) add optimazing options (#168)
* feat:(encoder) add option `NoCompactMarshaler` and `NoEscapeTextMarshaler`

* feat: add `EscapeHTML` to align with std lib
2022-01-05 14:20:46 +08:00
Yi Duan
fcfe1c4317
fix:(encoder) keep arguement buf alive (#166) 2021-12-31 17:15:35 +08:00
liu
1443eb3bcf
fix: move large-size local array to _Stack (#162)
* fix: move large-size local array to _Stack

* fix: adjust jsonstate and add alwaysinline

* fix: initialize types.JsonState's dbuf at prologue

* fix: replace `always_inline` with `inline`

* fix: remove unused types

* feat: update asm2asm

* fix: check stack size befor call JIT function

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-30 14:51:23 +08:00
Yi Duan
c3cb5de704
feat:(ast) support sorting node keys (#164)
* feat: ast.Node support ForEach() iteration (DFS)

Change-Id: Ia53f1db2814036e12b760dfbb7a21094a6abd541

* feat: support Node's key sorting

Change-Id: I0b93d9b4feada853fa2ca9f48277da71948a95be

* fmt

Change-Id: I1a53170959c08f1a32f02b0f163207254a87362c

* test: forbid `checkptr`

Change-Id: I6b34f74ee3bad883f515728300bf735a9e10b0d6

* fmt: add comments

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-28 20:29:09 +08:00
liu
8dfaa13d3e
fix: out-of-bounds accessing in advance_string() (#161)
* fix: out-of-bounds accessing in advance_string()

* fix: use Clang12 as C compiler

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-21 20:03:01 +08:00
Pure White
188e829dd7
chore(ci): setup self-hosted runner for ci (#158) 2021-12-20 19:56:07 +08:00
Yi Duan
8203bbac35
fix: remove stack writeBarrier for encoder (#159)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-20 17:26:19 +08:00
Yi Duan
22229eefc3
fix: relocate stack pointers (#156)
* fix: relocate stack pointer _VAR_sv to keep it alive

* fix: add stack pointer _VAR_vk to defend `encoding.TextUnmarshaler`

* fix: align faker func's stack with JIT func's

* fix: clear _Stack memory when err returned

* fix: clear stack pointer before return

* fix: relimit stack-overflow check at `_ValueDecoder`

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-20 16:19:12 +08:00
Yi Duan
e80837a84d
fix:(ast) quote string when node.MarshalJSON() (#155)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-15 19:20:18 +08:00
Yi Duan
8405d84e31
feat: optimaze ast.Node API as container of generic values (#150)
* opt: only skip one value when call Iterator.HasNext()

* feat: V_NONE supports Set() and Add()

* feat: add node type V_ANY

* feat: ast.Node implements `json.Unmarshaler`

* fmt: use space instead of tab for indent

* feat: node V_ANY cast to Bool()\Int64()\Float64()\String()\Number()\Map()\Array()Interface()

* feat: V_NULL supports Set() and Add()

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-09 15:43:51 +08:00
Yi Duan
7d3b22100f
feat: SyntaxError.Error() always calls Description() (#152)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-09 13:11:31 +08:00
liu
d5104197c4
fix: 'string' option in struct tag as encoding/json (#148)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2021-12-03 15:46:09 +08:00
Yi Duan
d2711a6af0
fix: use global var _KeepAlive to notice GC in shadow funcs (#145)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-02 11:08:40 +08:00
liu
3f2bab552b
doc: update readme (#143)
* doc: update readme

* test: add SetOne_XX() benchmarks

* doc: update bechmark charts

* doc: fix possible typos

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-12-01 18:03:19 +08:00
Yi Duan
49df11ef83
feat: adjust ABI for supporting go1.17 (#116)
* feat: adjust encoder ABI for supporting go1.17

* binding

* generic

* opt: exchange R10/R11 with BX/BP when call c func

* fmt

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-11-30 18:47:17 +08:00
liu
c27120f2bc
fix: correct the field priority as encoding/json when unmarshal to struct (#142) 2021-11-30 10:28:50 +08:00
liu
49fc705341
feat: Pretouch recursively for large/deep struct (#137) 2021-11-26 14:12:51 +08:00
liu
9a95e9de00
test: fix timeout problem in issue_test when enable force GC (#135)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2021-11-19 14:10:19 +08:00
Yi Duan
5b38f56cec
fix: go1.15 CANNOT support gcWriteBarrier due to linkname bug (#134)
* fix: go1.15 CANNOT add gcWriteBarrier due to linkname bug

* add go1.15 push-check

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-11-18 11:15:14 +08:00
Yi Duan
43e4a00e90
fix: add gc_write_barrier checks (#131)
* fix: add gcWriteBarrier for decode

* add gcWriteBarrier for encoder


Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-11-17 11:21:20 +08:00
Yi Duan
ba4c2d2e55
fix: set _Stack.sp zero whenever put into pool (#132)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-11-15 14:41:04 +08:00
Yi Duan
0f66ab7211
fix: add stack memory at _VAR_vp to pass the address of vp while recursing (#129)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-11-09 12:47:05 +08:00
Yi Duan
442ce696fb
fix: use stackmap of shadow func as jit func's (#127)
* fix: use stackmap of shadow func as jit func's

* fix: use LoadWithFaker in decoder

* fix: LoadWithFaker support go115

* add 'runtime.' prefix on jit funcname to prevent preempt

* add parallel GC tests

* remove no_stack_pointer()

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2021-11-09 11:50:40 +08:00
Yi Duan
3a25fcac4f
feat: add node.Load()/LoadAll() to support concurrency (#124)
Change-Id: Ic70b61c720a10d16cecc1f3d7c131d81ff6d4071

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-10-28 17:56:09 +08:00
Yi Duan
3eade82a01
fix: add gcGuard to prevent GC during Marshal()/Unmarshal() (#122)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-10-28 17:02:37 +08:00
liuqiang
fe56a21bf5 fix: make it return error when unmarshal invalid base64-encoded strings 2021-10-21 18:20:04 +08:00
liu
0a710eeb9d
fix: make it sorted when marshalling integer key map (#117) 2021-10-18 19:31:33 +08:00
liu
3eca433cb9
fix: marshal struct field with omitempty tag as encoding/json (#114) 2021-10-12 15:14:39 +08:00
liu
530d423243
fix: make it parse the UTF-16 surrogate pair after invalid unicode (#111) 2021-09-24 16:33:02 +08:00
liu
a7ace8cd03
fix: skip exponent number that begin with zero in skip_number() (#109) 2021-09-23 15:02:09 +08:00
Yi Duan
a577eafc25
refactor: make it more readable (#104)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-09-18 11:31:25 +08:00
chenzhuoyu
0e4b0b8ee1 fix: check character range before BTQ 2021-09-17 19:48:47 +08:00
Yi Duan
c1749cfd1f
fix(#100): check type-size of map element to decide whether use mapassign_fastxx (#102)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-09-16 20:13:29 +08:00
chenzhuoyu
8ccd57d4e0 fix: defer single-element maps checking 2021-09-14 18:41:45 +08:00
liuqiang
9ba912d20a fix: make it return error when unmarshal infinity float number 2021-09-14 18:17:45 +08:00
liuqiang
ec15697761 fix: support IEEE-754 negative zero in both marshal and unmarshal 2021-09-14 15:06:47 +08:00
chenzhuoyu
514208a4d5 fix: potential ProgramCache OOM under high-load 2021-09-09 14:35:01 +08:00
Oxygen
6aff4b1ad6
fix: handling of surrogate-half characters within double-quoted strings (#89) 2021-09-07 14:14:06 +08:00
Yi Duan
12e088f9e9
opt(ast): append string instead of []byte (#88)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
Co-authored-by: Oxygen <chenzhuoyu@users.noreply.github.com>
2021-09-06 16:58:03 +08:00
chenzhuoyu
d2e150948a fix: unmarshalers are always addressable 2021-09-06 16:53:51 +08:00
liu
365da9c1a8
fix: check prefix in native float parsing (#86) 2021-09-06 16:01:42 +08:00
Yi Duan
fa5f5026d9
opt(ast): speed up api (#85)
- inline findkey()
- use std append() instead of runtime.memmove()

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-09-03 20:05:52 +08:00
Yi Duan
1f13d31b5a
chore!: return error for scanning API (#81)
* chore!: return error for cast API

BREAKING CHANGE:
- Set()/Unset()/SetByIndex()/UnsetByIndex/Add() 
- Raw()/Bool()/Int64()/Float64()/Number()/Len()/Cap()
- Values()/Properties()/Map()/Array()/Interface()

Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-08-30 17:14:38 +08:00
Yi Duan
6aec2f3722
feat(ast): Node supports MarshalJson() (#84)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-08-27 18:28:56 +08:00
Yi Duan
8c119dd72d
feat(ast): support Node.Unset() and optimize Node.Get() (#80)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-08-24 13:23:55 +08:00
chenzhuoyu
ae862b18dc chore: update base64x 2021-08-23 17:13:48 +08:00