replace all ocurrences of encoding/json with json-iterator so we get rid of HTML escaping and hopefully get faster too.

This commit is contained in:
fiatjaf
2024-12-03 00:49:27 -03:00
parent 6f778f85ba
commit 72d9aac9b1
24 changed files with 39 additions and 35 deletions

View File

@@ -6,12 +6,16 @@ import (
"sync"
"unsafe"
jsoniter "github.com/json-iterator/go"
"golang.org/x/exp/constraints"
)
const MAX_LOCKS = 50
var namedMutexPool = make([]sync.Mutex, MAX_LOCKS)
var (
namedMutexPool = make([]sync.Mutex, MAX_LOCKS)
json = jsoniter.ConfigFastest
)
//go:noescape
//go:linkname memhash runtime.memhash