From d37f32deb6cd6a575cc169adf1a1c1fba44e53d9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 4 Jul 2025 15:35:16 +0300 Subject: feat: add Profile-Guided Optimization (PGO) support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add comprehensive PGO module in internal/tools/pgo/ - Integrate PGO into dtail-tools command with full CLI support - Add Makefile targets for PGO workflow: - make pgo: Full PGO workflow - make pgo-quick: Quick PGO with smaller datasets - make pgo-generate: Generate profiles only - make build-pgo: Build with existing profiles - make install-pgo: Install optimized binaries - Add convenience functions to data generator for PGO - Document PGO workflow in CLAUDE.md Performance improvements observed: - DCat: 3.8-7.0% additional improvement over turbo mode - DGrep: Up to 19% improvement for low hit rates - DMap: Variable impact, up to 64% for min_max on large files Benchmarks show total performance gains (pre-turbo → turbo+PGO): - DCat: 14-21x faster - DGrep: 9-15x faster - DMap: 9-29% faster 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- cmd/dtail-tools/main.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd') diff --git a/cmd/dtail-tools/main.go b/cmd/dtail-tools/main.go index 591ed4b..2b96a56 100644 --- a/cmd/dtail-tools/main.go +++ b/cmd/dtail-tools/main.go @@ -5,6 +5,7 @@ import ( "os" "github.com/mimecast/dtail/internal/tools/benchmark" + "github.com/mimecast/dtail/internal/tools/pgo" "github.com/mimecast/dtail/internal/tools/profile" ) @@ -30,6 +31,11 @@ func main() { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } + case "pgo": + if err := pgo.Run(); err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } case "help", "-h", "--help": printUsage() default: @@ -47,6 +53,7 @@ func printUsage() { fmt.Println("Commands:") fmt.Println(" profile Run profiling on dtail commands") fmt.Println(" benchmark Run benchmarks and manage baselines") + fmt.Println(" pgo Profile-Guided Optimization for dtail commands") fmt.Println(" help Show this help message") fmt.Println() fmt.Println("Run 'dtail-tools -h' for command-specific help") -- cgit v1.2.3