ridiculous performance string and serialization performance improvements.

This commit is contained in:
fiatjaf
2025-03-07 21:45:47 -03:00
parent 4431f58df2
commit 9e94310604
6 changed files with 18 additions and 13 deletions

View File

@ -7,6 +7,7 @@ import (
"unsafe"
"github.com/bytedance/sonic/ast"
"github.com/colduction/nocopy"
)
type sonicVisitorPosition int
@ -549,7 +550,7 @@ func (smp sonicMessageParser) ParseMessage(message []byte) (Envelope, error) {
sv := &sonicVisitor{smp: &smp}
sv.whereWeAre = inEnvelope
err := ast.Preorder(string(message), sv, nil)
err := ast.Preorder(nocopy.ByteSliceToString(message), sv, nil)
return sv.mainEnvelope, err
}