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

151 commits

Author SHA1 Message Date
Yi Duan
518110bd99
feat:(decoder) clear memory when decoding failed (#320)
* feat:(decoder) clear memory when decoding failed

* fix test case

* fix: skip empty string for `,string` option

* test map text key

* support skip mismatched key-value of map
2022-11-07 11:04:19 +08:00
Yi Duan
02fe88266f
feat:(decoder) support skip mismatche-typed value (#325)
* feat:(decoder) support skip mismatche-typed value

* change test cases

* refactor: add type check down into `CompilePrimitive()` to avoid repeat `null` check

* opt call skip()

* bench: add  option `--repeat_times`

* test: omit check primitive

* opt: inline primitive check into its OP

* implement on Go1.15

* fix: support skip json.Numer

* fix: OP_go_skip

* update README.md
2022-11-04 14:27:21 +08:00
linuxsong
2866800519
optimize type assertion (#324) 2022-10-31 12:47:12 +08:00
liu
78c2ade913
fix: readme typos (#323) 2022-10-28 17:32:48 +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
linuxsong
3e6f839fb6
fix iterator traversal empty object panic (#314) 2022-10-18 10:59:51 +08:00
Keyi Xie
b52e528dc6
feat: add dummy implementation of pretouch() for !amd64 arch (#306)
* feat: 🎸 (sonic.go): Add none implement for !amd64 arch

 Closes: #301

* Add test

* Address comment
2022-09-28 13:58:24 +08:00
liu
56e81a633e
fix: use sse instead of sse4 (#305)
* fix: use sse instead of sse4

* fix: use dispatch

* fix: remove lzero

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-09-26 12:45:01 +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
2138136685
feat: support more loose type-casting (#294)
* feat: support more losing type cast

* test: add loose casting tests

* format

* fmt: add license

* fmt: add comments
2022-09-08 16:31:38 +08:00
Yi Duan
a48cad8488
fix:(decoder) more loose repeatable condition for StreamDecoder (#296) 2022-09-08 16:16:38 +08:00
Yi Duan
6e979df0d3
fix:(decoder) StreamDecoder unexpectedly stop while skipping incomplete number (#295) 2022-09-07 19:54:13 +08:00
Chen Yannan
0a3d980974
Fix/ci (#292)
* install qemu in CI

* install qemu in CI
2022-08-31 17:27:11 +08:00
Yi Duan
cf08d54edd
feat:(ast) support cast null to empty value (#278) 2022-08-22 16:11:26 +08:00
Yi Duan
94f95f0479
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
2022-08-22 15:45:49 +08:00
Yi Duan
1a7758c557
build: all fallbacks to compact.go on ARM arch (#286) 2022-08-18 20:56:22 +08:00
cyn6315
dd3e092a5b
fix spelling mistake in README.md (#285)
* fix spelling mistake in README.md

* fix spelling mistake in README.md
2022-08-18 17:14:46 +08:00
cyn6315
d1190d6797
change push-check-arm.yml and remove fall back logics (#284)
* change push-check-arm.yml and remove fall back logics

* fix README on the requirement and compatibility

* fix: README on the requirement and compatibility

* fix: README add backquotes

* fix:remove instruction set requirement in README

* Update README.md

Co-authored-by: Yi Duan <duanyi.aster@bytedance.com>
2022-08-18 15:58:07 +08:00
cyn6315
a8311c6cde
fix: adapts to Mac M1 (#280)
* fix: adapts to Mac M1
* feat: add `noavx` mode
* fix: fix SSE4 segfault with latest asm2asm
* chore: remove excessive spaces
* chore: more compact assembly
* chore: re-indent with 4 spaces
* chore: remove excessive space

Co-authored-by: chenzhuoyu <chenzhuoyu@bytedance.com>
2022-08-15 14:37:20 +08:00
chenzhuoyu
d4024becca chore: remove excessive spaces 2022-08-12 15:29:23 +08:00
liu
de2dc2c35a
add ValidateString option into decode (#253)
* fix: add escape validate

* feat: add validatestring option

* add print debug

* add jit debug in decoder

* fix go1.16 decoder debug

* fix: not change others

* fix generic parse bug

* remove debug info

* test twitter json

* fix: option typos

* test: add bug test

* fix validate bugs

* fix: validate

* remove files

* re-compile

* update license

* add flags on `skip_xxx()`

* fix internal native tests

* re-compile

* add validstring for perftest

* modify api

* fix readme

* fix comment

* add license

* rename to ValidateString

* fix xprintf.h

* add debug

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-08-11 19:06:11 +08:00
Yi Duan
b36771ba37
feat: support Go 1.19 (#275)
* feat: support Go 1.19

* fuzz test refactor

* fix fuzz bug, generate pointer typ

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-08-09 12:54:11 +08:00
Yi Duan
8b51e75241
fix:(encoder) insufficient buffer size check for OP_i32 (#269) 2022-07-28 17:18:53 +08:00
Yi Duan
2eae594741
fix:(native) StreamDecoder returns error when run out of buffer while skiping value (#267)
* fix:(native) StreamDecoder return error when run out of input buffer while skiping value

* refactor
2022-07-25 15:17:52 +08:00
liu
34026b9c65
fix: useint64 in decode SetOption (#268)
* fix: useint64 in decode SetOption

* doc: add comments on `sonic.Config`

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-07-25 14:26:18 +08:00
Yi Duan
755c0252a9
feat: (ast) support casting V_STRING to number (#262) 2022-07-12 16:27:27 +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
08c7640684
fix:(decoder) didn't check ',' before object key due to imperfect FSM (#261) 2022-07-08 11:12:34 +08:00
Yi Duan
a66db08b94
fix:(encoder) handle map like pointer when calling call_marshaler_v (#259) 2022-07-06 14:50:28 +08:00
Yi Duan
55e3d10619
fix: (decoder) return io.EOF when read nothing from io.Reader (#254)
* fix: (decoder) return io.EOF when read nothing from io.Reader

* build:(CI) codeql-analysis only use x86 machine
2022-07-01 17:51:42 +08:00
Yi Duan
fc6f3743fd
fix:(ast) checkRaw() check if node is nil pointer first (#250) 2022-06-28 14:16:10 +08:00
Yi Duan
2e751bf5db
feat:(ast) Add more strict casting API (#249)
* feat:(ast) Add more strict API

* test: add cast test
2022-06-28 13:27:07 +08:00
liu
f8fb04a184
fix(ub): marshal escape b f as encoding/json (#243)
* fix(ub): marshal b f as encoding/json

* test: fix old test for escape b

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-06-10 11:21:35 +08:00
liu
410625ca9e
opt: remove bound and loop unrolling in quote (begin to use clang13) (#237)
* opt: remove most bound check in quote

* opt: remove branch in copied escaped chars

* opt: use cache-friendly bool array

* opt: use loop unrolling in quote

* feat: add `-t` for bench.py

Change-Id: I3f41218187597126ef960eab09c6fa6fe252f347

* test:(bench) adjust repeat_time

* test: add Diff on CI

* test: update bench.py

* doc: update README.md

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-06-08 21:50:10 +08:00
liu
3717c62ec2
test: add generic benchmark (#239)
* test: add generic benchmark

* test: add ci

* chore: adjust generic benchmark variable name

* ci: fix compare bug in bench.py

* build: adjust CI yaml

* test: use sonic.Config

* chore: generic test

* test: add interface type bench

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-06-07 13:26:28 +08:00
Yi Duan
ced28302a9
feat: add compatible API (#233)
* feat: add compatible API

* test: add api compatibility test

* fmt

* test: adjust CI

* fix: no trailing '\n' for std `Marshal()`

* doc: update README.md

* test: add windows CI

* doc: update README.md

* doc: update README.md

* fmt: add comments and refator
2022-05-25 14:16:56 +08:00
liu
8917a0a7d9
chore: add script to bench different git branches (#232)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-05-24 14:13:07 +08:00
Yi Duan
f9d033d6f8
feat: support streaming IO (#225)
* feat (decoder): support streaming IO

* opt: fine tune buffer size factors

* feat (encoder): support streaming IO

* doc: refactor format and add comments

* fix: io.EOF dead loop

* build: adjust CI files

* doc: update README.md
2022-05-24 10:38:43 +08:00
75b728ba51
feat: support for Windows (#228)
* feat: support for Windows

* fix (loader): default loader now has build tag: for linux and darwin
* feat (loader): add memory allocator support for Windows

* feat: add Windows CI

Added Windows CI for GitHub Actions
Go version: 1.15.x, 1.16.x, 1.17.x, 1.18.x

* fix (loader): remove `amd64` build constraint from Windows

* fix: TSAN error on Windows CI

Temporary remove `-race` flag

Link: https://github.com/golang/go/issues/46099

Co-authored-by: Yi Duan <duanyi.aster@bytedance.com>
2022-05-23 12:55:45 +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
Yi Duan
5086cb21fe
fix: add nil pointer check (#224)
* fix: add nil pointer check

* panicNilPointerOfNonEmptyString
2022-05-19 13:24:57 +08:00
liu
d923a03329
fix: some typos (#221)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-05-19 11:41:01 +08:00
Yi Duan
9aab4704ef
fix: issux213 (#215)
* fix (decoder): use AVX mode only on base64x
2022-04-21 15:29:52 +08:00
liu
2c8299dd44
chore: update readme (#220)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-04-21 14:14:24 +08:00
liu
57dea971c6
chore: update readme (#219) 2022-04-21 03:35:32 +00:00
liu
57989f38ba
opt: skip number in json.Number parsing (#209)
* opt: skip number in json.Number  parsing

* fix: generic use skip_number

* test: add json.Number decoding benchmarks

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com>
2022-04-01 17:45:06 +08:00
Yi Duan
fe2497d01e
fix:(loader) init _Moduledata.gcdatapointer to avoid panic on plugin-mode (#188)
* fix:(loader) init `_Moduledata.gcdata`pointer to avoid panic on plugin-mode

* fix: freeze gcdata pointer

* feat: go115

* update test

* fix: use unique bytes pointer

* test: drop go1.15 race test

* feat: support go1.18
2022-04-01 16:46:07 +08:00
liu
d9b9980291
test: add fuzz test in Go 1.18 (#208) 2022-04-01 15:04:54 +08:00
Yi Duan
cb1702dc8c
feat: support Go1.18 (#205)
* feat: support Go1.18

* fix: re-encoding `moduledata.pclntab`

* test: add generic func wrap test
2022-03-28 20:43:43 +08:00