Optimize deletion timestamp lookup by replacing sorting logic with linear scan to improve performance. Add profiling support with cmd/benchmark/profile.sh, introduce network load testing in benchmarks, and update benchmark reports with additional latency metrics (P90, bottom 10%).

This commit is contained in:
2025-09-12 23:47:53 +01:00
parent fefa4d202e
commit c45276ef08
14 changed files with 1788 additions and 63 deletions

13
main.go
View File

@@ -8,6 +8,7 @@ import (
"os/signal"
"time"
"github.com/pkg/profile"
"lol.mleku.dev/chk"
"lol.mleku.dev/log"
"next.orly.dev/app"
@@ -23,7 +24,17 @@ func main() {
if cfg, err = config.New(); chk.T(err) {
}
log.I.F("starting %s %s", cfg.AppName, version.V)
startProfiler(cfg.Pprof)
switch cfg.Pprof {
case "cpu":
prof := profile.Start(profile.CPUProfile)
defer prof.Stop()
case "memory":
prof := profile.Start(profile.MemProfile)
defer prof.Stop()
case "allocation":
prof := profile.Start(profile.MemProfileAllocs)
defer prof.Stop()
}
ctx, cancel := context.WithCancel(context.Background())
var db *database.D
if db, err = database.New(