mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-07-12 20:42:25 +02:00
ridiculous performance string and serialization performance improvements.
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user