feat(json): improve JSON performance with bytedance/sonic

This commit is contained in:
yusing
2025-09-29 17:43:34 +08:00
parent 024100aa8c
commit f411e17d80
29 changed files with 86 additions and 78 deletions

View File

@@ -1,8 +1,9 @@
package rules
import (
"encoding/json"
"net/http"
"github.com/bytedance/sonic"
)
type (
@@ -117,7 +118,7 @@ func (rules Rules) MarshalJSON() ([]byte, error) {
for i, rule := range rules {
names[i] = rule.Name
}
return json.Marshal(names)
return sonic.Marshal(names)
}
func (rule *Rule) String() string {