fix(makefile): restrict bench target to internal directory

- Change ./... to ./internal/... to avoid scanning lib/fasthttp
- Add -run=^$$ to skip regular tests, run only benchmarks
- Properly escape $ in Makefile with $$

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-04-30 00:05:54 +08:00
parent 4dfd6df38b
commit 0de9922e7d

View File

@ -214,10 +214,10 @@ act-unit:
exit 1; \
fi
# 运行基准测试(输出到文件
# 运行基准测试(输出到文件,仅扫描 internal 目录
bench:
@echo "Running benchmarks..."
go test -bench=. -benchmem -count=5 ./... 2>&1 | tee bench-results.txt
go test -bench=. -benchmem -count=5 -run=^$$ ./internal/... | tee bench-results.txt
# 运行基准测试统计模式10次采样
bench-stat: