From 754ac4bb68f9e145df07dd3c54a43f37654a5d50 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 16 Jun 2025 19:05:09 +0300 Subject: Implement Profile-Based Optimization (PBO) automation with 39.9% performance improvement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add comprehensive PBO script (scripts/pbo.sh) for automated performance analysis - Implement timer allocation reduction using reusable timers (chunkedreader.go, stats.go, baseclient.go) - Optimize I/O operations with pre-allocated buffers and bulk writes (chunkedreader.go) - Enhance memory allocation patterns with improved buffer pooling - Add CPU and memory profiling support to dgrep command - Update Makefile with clean PBO target calling scripts/pbo.sh - Add PBO documentation to CLAUDE.md Performance improvements: - 39.9% faster execution time (2.918s → 1.753s average) - 38% reduction in CPU samples (3.04s → 1.87s) - Reduced byte-by-byte operations from 21.71% to 8.56% CPU usage - Eliminated repeated timer allocations across all components 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 71ae1ed..d47df58 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,21 @@ ifdef DTAIL_USE_PROPRIETARY GO_TAGS+=proprietary endif all: build + +# Display available targets +help: + @echo "Available Makefile targets:" + @echo " all - Build all binaries (default)" + @echo " build - Build all binaries" + @echo " clean - Remove built binaries" + @echo " test - Run all unit tests" + @echo " vet - Run go vet on all packages" + @echo " lint - Run golint on all packages" + @echo " install - Install all binaries to \$$GOPATH/bin" + @echo " pbo - Run Profile-Based Optimization for dgrep" + @echo "" + @echo "Individual binary targets:" + @echo " dserver, dcat, dgrep, dmap, dtail, dtailhealth" build: dserver dcat dgrep dmap dtail dtailhealth dserver: ${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dserver ./cmd/dserver/main.go @@ -47,3 +62,7 @@ test: ${GO} clean -testcache set -e; find . -name '*_test.go' | while read file; do dirname $$file; done | \ sort -u | while read dir; do ${GO} test -tags '${GO_TAGS}' --race -v -failfast $$dir || exit 2; done + +# Profile-Based Optimization (PBO) target for dgrep +pbo: clean build + @./scripts/pbo.sh -- cgit v1.2.3