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 --- CLAUDE.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md index f42f64b..c48aa35 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -42,6 +42,20 @@ make vet make lint ``` +### Performance Optimization +```bash +# Run Profile-Based Optimization (PBO) for dgrep +make pbo + +# This target will: +# - Create test file (100MB with 1M lines) if needed +# - Run baseline profiling (CPU and memory) +# - Run performance benchmarks +# - Generate optimized profiles +# - Create detailed comparison report (pbo_report.txt) +# - Show key optimizations implemented +``` + ### Installation ```bash # Install all binaries to $GOPATH/bin -- cgit v1.2.3