summaryrefslogtreecommitdiff
path: root/internal/tools/common
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-04 15:35:16 +0300
committerPaul Buetow <paul@buetow.org>2025-07-04 15:35:16 +0300
commitd37f32deb6cd6a575cc169adf1a1c1fba44e53d9 (patch)
treeaaf5f6abc90066892a6a23cb619969ddd4ef5574 /internal/tools/common
parent1249f9ec51b1355ca17f73244dcbe0acc5556516 (diff)
feat: add Profile-Guided Optimization (PGO) support
- 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 <noreply@anthropic.com>
Diffstat (limited to 'internal/tools/common')
-rw-r--r--internal/tools/common/data_generator.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/tools/common/data_generator.go b/internal/tools/common/data_generator.go
index f9c4e5e..9446d8a 100644
--- a/internal/tools/common/data_generator.go
+++ b/internal/tools/common/data_generator.go
@@ -245,4 +245,22 @@ func (g *DataGenerator) generateDTailFormatFileWithLines(filename string, lines
}
return nil
+}
+
+// GenerateLogFile generates a log file with specified number of lines
+// This is a convenience function for PGO module
+func GenerateLogFile(filename string, lines int) error {
+ g := NewDataGenerator()
+ // Estimate size based on average line length (about 100 bytes per line)
+ estimatedSize := int64(lines * 100)
+ return g.generateLogFile(filename, estimatedSize)
+}
+
+// GenerateCSVFile generates a CSV file with specified number of lines
+// This is a convenience function for PGO module
+func GenerateCSVFile(filename string, lines int) error {
+ g := NewDataGenerator()
+ // Estimate size based on average line length (about 50 bytes per line)
+ estimatedSize := int64(lines * 50)
+ return g.generateCSVFile(filename, estimatedSize)
} \ No newline at end of file