处理AI胡乱生成的乱摊子
This commit is contained in:
14
vendor/github.com/bytedance/sonic/option/option.go
generated
vendored
14
vendor/github.com/bytedance/sonic/option/option.go
generated
vendored
@@ -18,10 +18,17 @@ package option
|
||||
|
||||
var (
|
||||
// DefaultDecoderBufferSize is the initial buffer size of StreamDecoder
|
||||
DefaultDecoderBufferSize uint = 128 * 1024
|
||||
DefaultDecoderBufferSize uint = 4 * 1024
|
||||
|
||||
// DefaultEncoderBufferSize is the initial buffer size of Encoder
|
||||
DefaultEncoderBufferSize uint = 128 * 1024
|
||||
DefaultEncoderBufferSize uint = 4 * 1024
|
||||
|
||||
// DefaultAstBufferSize is the initial buffer size of ast.Node.MarshalJSON()
|
||||
DefaultAstBufferSize uint = 4 * 1024
|
||||
|
||||
// LimitBufferSize indicates the max pool buffer size, in case of OOM.
|
||||
// See issue https://github.com/bytedance/sonic/issues/614
|
||||
LimitBufferSize uint = 1024 * 1024
|
||||
)
|
||||
|
||||
// CompileOptions includes all options for encoder or decoder compiler.
|
||||
@@ -61,7 +68,7 @@ type CompileOption func(o *CompileOptions)
|
||||
//
|
||||
// For deep nested struct (depth exceeds MaxInlineDepth),
|
||||
// try to set more loops to completely compile,
|
||||
// thus reduce JIT unstability in the first hit.
|
||||
// thus reduce JIT instability in the first hit.
|
||||
func WithCompileRecursiveDepth(loop int) CompileOption {
|
||||
return func(o *CompileOptions) {
|
||||
if loop < 0 {
|
||||
@@ -83,4 +90,3 @@ func WithCompileMaxInlineDepth(depth int) CompileOption {
|
||||
o.MaxInlineDepth = depth
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user