性能优化: 热路径零分配, 自适应池CAS无锁化, 锁外计算

- port_scan: fmt.Sprintf→JoinHostPort+fmtPort零分配地址格式化 (2.5x)
- port_scan: strings.ToLower→containsFold零分配大小写不敏感匹配 (2.5x)
- port_scan: slidingWindowSchedule修复semaphore泄漏bug
- service_probe: readFromConn预分配4KB缓冲区消除扩容
- adaptive_pool: maybeAdjust用atomic CAS代替持锁检查, 99%免锁
- adaptive_timeout: Timeout锁外计算均值/标准差, 只锁缓存更新
- 新增perf_bench_test.go基准测试验证所有优化
This commit is contained in:
ZacharyZcR
2026-05-18 06:11:10 +08:00
parent 639298b7c8
commit 7063027acf
6 changed files with 226 additions and 44 deletions
+1 -1
View File
@@ -662,7 +662,7 @@ func TestIsResourceExhaustedError_EdgeCases(t *testing.T) {
{
name: "大小写混合",
err: fmt.Errorf("Too Many Open Files"),
expected: false, // 当前实现区分大小写
expected: true, // containsFold 不区分大小写
},
{
name: "错误信息包含但不完全匹配",