Yi Duan
685ea7b9e3
feat:(encoder) support concrete-type key implementing encoding.TextMarshaler while encoding map ( #343 )
...
* feat:(encoder) support concrete type implementing `encoding.TextMarshaler` while encoding map
* add missing license
* opt: use unsafe to avoid reflect.Call
2022-12-30 17:48:04 +08:00
liu
6deed01a90
opt: reduce memory pool size ( #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 <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-10-28 16:40:14 +08:00
Chen Yannan
5e54c02172
fmt: move thrid-party tests into another module ( #299 )
...
* fix:move benchmarkTests and unitTests related to external json library
* remove extra spaces
* merge go.mod files
* refactor: add external_jsonlib_test into go.work and CI
Co-authored-by: Yi Duan <duanyi.aster@bytedance.com>
2022-09-20 12:02:41 +08:00
liu
ccc0f3f1e3
opt: faster ftoa ( #291 )
...
* opt: faster f64toa
* feat:(option) add option `MaxInlineDepth` for addjust compilation inline depth (#287 )
* feat: make compilation depth changeable
* feat: add option `DefaultMaxInlineDepth`
* add recurse depth = 10
* refactor
* doc: readme and comment
* opt: add `_MAX_FIELDS` to limit the inlining of big struct
* update license
* fix typo
* feat:(ast) support cast `null` to empty value (#278 )
* fix: recompile
* test: add ftoa benchmarks
* feat: add f32toa
* fix: add license
* opt: optimize decimal
* fix benchmarks
* fix: poor performance in atof32
* test: add more integer test
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: Yi Duan <duanyi.aster@bytedance.com>
2022-09-20 10:26:18 +08:00
Yi Duan
07d7b867d4
feat (encoder): add encoder option NoNullSliceOrMap ( #218 )
...
* feat (encoder): add encoder option `NoNullSliceOrMap`
* feat: add option on `sonic.Config`
* build: specify `self-host` to x64 machine
2022-07-08 15:07:42 +08:00
Yi Duan
308b76b44f
fix (encoder): spill RL (buffer length) register while calling internal encoders in case of it got scratched ( #230 )
...
Change-Id: Ie15c589b739a7b3feb93c5a7b65e82c114d7ab80
2022-05-23 12:27:29 +08:00
liu
ce41dd9636
fix: correct htmlescape chars check ( #190 )
...
* fix: correct htmlescape chars check
* fix: continuous html escape chars
* tmp: compile clang13
* fix: check single xe2 char
* fix: htmlescape no mem test
* fix: htmlescape zero check bug
* fix: htmlescape bug
* build: clang12
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-02-22 11:43:58 +08:00
liu
7475b256ce
support JSON validate ( #189 )
...
* fix: check unescaped control chars in decode
* feat: add utf8 validate func
* feat: validate utf8 in json string
* feat: add validateone api
* fix: check unicode pointer for surrogate
* clang12 compile
* feat: Import `Valid()` and `Skip()`
* opt: use looktable
* fix utf-8 validate performance problem
* fix: utf-8 validate bug
* clang12 build
* feat: (encoder) accelerate validating json from `json.Marshaler`
chore!:
- `encoder.NoCompactMarshaler`changes to `encoder.CompactMarshaler`, which means compacting operation is not open by default
* fix: only one json value is `Valid()`
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-02-21 16:35:53 +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
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
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
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
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
chenzhuoyu
8383178c89
feat: supports map key-sorting via encoder options
2021-08-16 18:31:41 +08:00
Masaaki Goshima
4e02b5b2fe
Update benchmark ( #34 )
...
* chore: update version of goccy/go-json to v0.7.2
* chore: use unordered map option at encoding for go-json's benchmark
2021-06-26 10:43:10 +08:00
chenzhuoyu
944f2b58cc
chore: sort imports
2021-06-22 16:47:57 +08:00
Yi Duan
936cee0d3f
test: benchmark with github.com/goccy/go-json ( #23 )
...
chore: add benchmark result with go-json
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2021-06-22 16:30:04 +08:00
chenzhuoyu
fbe0828190
chore: make it open-source
2021-05-28 23:58:58 +08:00