You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
allocate less buffer for writing to []byte
This commit is contained in:
@ -83,7 +83,7 @@ func UnmarshalAnyFromString(str string) (Any, error) {
|
||||
|
||||
func Marshal(v interface{}) ([]byte, error) {
|
||||
buf := &bytes.Buffer{}
|
||||
stream := NewStream(buf, 4096)
|
||||
stream := NewStream(buf, 512)
|
||||
stream.WriteVal(v)
|
||||
stream.Flush()
|
||||
if stream.Error != nil {
|
||||
|
Reference in New Issue
Block a user