perf(mem): replace Scheme and ExcludedReason string with uint8 type to reduce mem usage

This commit is contained in:
yusing
2025-10-15 14:35:44 +08:00
parent feafdf05f2
commit 290af4e311
6 changed files with 160 additions and 61 deletions

View File

@@ -13,6 +13,7 @@ import (
. "github.com/yusing/godoxy/internal/entrypoint"
"github.com/yusing/godoxy/internal/route"
"github.com/yusing/godoxy/internal/route/routes"
routeTypes "github.com/yusing/godoxy/internal/route/types"
"github.com/yusing/godoxy/internal/types"
"github.com/yusing/goutils/task"
)
@@ -78,7 +79,7 @@ func BenchmarkEntrypointReal(b *testing.B) {
r := &route.Route{
Alias: "test",
Scheme: "http",
Scheme: routeTypes.SchemeHTTP,
Host: host,
Port: route.Port{Proxy: portInt},
HealthCheck: &types.HealthCheckConfig{Disable: true},
@@ -119,7 +120,7 @@ func BenchmarkEntrypoint(b *testing.B) {
r := &route.Route{
Alias: "test",
Scheme: "http",
Scheme: routeTypes.SchemeHTTP,
Host: "localhost",
Port: route.Port{
Proxy: 8080,