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

176 commits

Author SHA1 Message Date
liu
8639e93666
fix: validate on demand at first for GetByPath and NewRaw (#389)
* feat(ast): validate the demanded fields for ast Get

* fix: add more tests

* fix: check invalid path type

* fix(arm): make return error when skip invalid exponent

* fix(arm): skip object and array with validate

* fix: check input json in NewRaw

* fix: validate the path in native c

* chore: add licenses

* fix: panic when invalid path

* fix: add Get Full json benchmark

* fix(arm): use fast skip besides the ondemand fields

* chore codes

---------

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2023-03-22 19:23:44 +08:00
Yi Duan
ddd5cd6c12
fix:(loader) add mutex lock for registerModule (#388) 2023-03-20 21:10:22 +08:00
liu
114b8168d4
fix: match empty string in path (#387) 2023-03-19 19:21:40 +08:00
Yi Duan
8dbcce341b
fix: decimal map key may be truncated and populated unexpectedly (#382)
* fix:(StreamDecoder) Integer map key may be truncated and populated unexpectedly

* feat: expose option `DefaultBufferSize`

* test adjust

* test adjust

* feat: add options to make default buffer size adjustable
2023-03-14 13:49:27 +08:00
liu
8f1e08ca4e
fix: validate empty object/array in ast Get (#383) 2023-03-14 13:05:23 +08:00
liu
18d2734975
fix: export not found error in ast get (#380) 2023-03-13 16:54:18 +08:00
liu
1f2f83e72e
fix(ast): out-of-bound for single unclosed string (#376)
* fix(ast): out-of-bound for single unclosed string

* test: add more ast getbypath tests
2023-03-07 15:52:34 +08:00
liu
10e45e906d
fix(ast): return error when get from single json value (#373)
* fix(ast): return error when get from single json value

* fix: fallback impl of skipstring
2023-03-02 12:45:35 +08:00
Yi Duan
6d60889e3b
build: omit checkptr detects on unsafe functions (#372)
* build: omit `checkptr` detect on unsafe functions

* update CI
2023-02-28 19:13:19 +08:00
liu
3696f9175b
fix: free the large buffer from pool (#369)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2023-02-24 17:31:26 +08:00
Yi Duan
e60b9541cd
fix: add nocheckptr directive (#365) 2023-02-20 14:52:46 +08:00
Yi Duan
a978cdb8c5
feat: generic loader for go1.16~1.17 (#362)
* feat: generic loader for go1.16

* delete unused codes
2023-02-15 15:36:40 +08:00
Yi Duan
fa82a64ce2
feat: add env option SONIC_STOP_PROFILING to stop traceback on demands (#361) 2023-02-14 14:48:22 +08:00
liu
02865de676
feat: repl invalid utf8 in serde by option (#357) 2023-02-10 18:55:27 +08:00
Yi Duan
f87d87de7a
feat: fallback on unsupported go versions (#358)
* feat: fallback api on unsupported go version

* add compact test

* not support go version <= 1.14
2023-02-08 16:56:10 +08:00
Yi Duan
e7ac2f25fc
feat: more complete function loader (#354)
* follow complete implementation of go symtab
* support go1.20
2023-02-08 14:35:00 +08:00
Yi Duan
cfa4fe1736
feat: add Get() API on not-amd64 envs (#350) 2023-01-13 11:34:20 +08:00
Yi Duan
32877b6d27
fix:(decoder) not clear memory after decoding failed (#346)
* fix: not clear memory after decoding failed

* doc: update sonic ast benchmark data
2023-01-10 14:19:32 +08:00
liu
2dc405d750
opt: faster skip in ast (#345)
* opt: faster skip in ast

* ci: remove excited repo
2023-01-09 16:20:36 +08:00
Yi Duan
67cffb15bd
feat:(ast) add fallback api on not-amd64 env (#341)
* feat:(ast) add  fallback api on `not-amd64` env

* test: add native `linux-arm64` CI

* opt: just skip number chars whne `decodeFloat64`

* fmt

* fix: check EOF
2023-01-03 19:47:55 +08:00
Yi Duan
134fba2c1d
feat: ignore SIGPROF while calling native funcs (#342) 2023-01-03 15:15:51 +08:00
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
Yi Duan
f421ee8530
fix:(encoder) pass pv through compiler recursively (#336)
* pass pv

* test reflect indirect

* fix: pass `pv` throught compiler recursively
2022-12-13 14:26:58 +08:00
erin liman
01c0d36194
feat: reformat print error example and clarify v1.6.0 example (#332) 2022-12-09 17:00:49 +08:00
liu
dda5da9f64
fix: support decode json-encoded base64 in JIT (#329)
Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
2022-11-15 16:38:08 +08:00
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