diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-17 15:29:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-17 15:29:23 +0300 |
| commit | 97ee9b51a8685d11a15d6efd426a58573081c6aa (patch) | |
| tree | 6cc9bb8774df5218d6ee74a4e8c99a083b27ff6e | |
| parent | c9c037275e4a5f2c8c87d736f3521c0817770798 (diff) | |
Add comprehensive performance benchmark results for channelless implementation
- Document 4-5x performance improvements for dgrep operations
- Include detailed test results across different scenarios (basic filtering, context lines, rare patterns)
- Provide technical analysis of why channelless architecture is faster
- Identify optimal use cases and limitations
- 50MB test file with 698k lines shows consistent speedup across all grep scenarios
Key results:
- Basic ERROR filtering: 4.5x faster (0.528s → 0.117s)
- ERROR with context lines: 5.4x faster (1.224s → 0.225s)
- Rare pattern filtering: 4.2x faster (0.428s → 0.103s)
- DCAT full file read: 19% slower (expected due to protocol overhead)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
| -rw-r--r-- | scripts/compare.txt | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/scripts/compare.txt b/scripts/compare.txt new file mode 100644 index 0000000..545dde8 --- /dev/null +++ b/scripts/compare.txt @@ -0,0 +1,154 @@ +# DTail Channelless Performance Benchmark Results + +## Executive Summary + +The new channelless architecture for DTail delivers dramatic performance improvements for grep operations, with 4-5x speedup across different scenarios while maintaining full compatibility with existing functionality. + +## Test Environment + +- **File**: benchmark_large.log (50MB, 698,333 lines) +- **Hardware**: 8 CPU cores, 31Gi RAM +- **Go version**: go1.24.3 +- **Test date**: 2025-06-17 + +## Detailed Results + +### 1. Basic ERROR Filtering +``` +Pattern: "ERROR" +Expected matches: ~87,000 lines + +OLD (channel-based): + Run 1: 0.515 seconds + Run 2: 0.524 seconds + Run 3: 0.526 seconds + Run 4: 0.530 seconds + Run 5: 0.544 seconds + Average: 0.528 seconds + +NEW (channelless): + Run 1: 0.117 seconds + Run 2: 0.116 seconds + Run 3: 0.115 seconds + Run 4: 0.120 seconds + Run 5: 0.117 seconds + Average: 0.117 seconds + +IMPROVEMENT: 4.5x faster (78% reduction) +``` + +### 2. ERROR Filtering with Context Lines +``` +Pattern: "ERROR" --before 2 --after 2 +Expected output: ~435,000 lines (with context) + +OLD (channel-based): + Run 1: 1.238 seconds + Run 2: 1.217 seconds + Run 3: 1.185 seconds + Run 4: 1.293 seconds + Run 5: 1.189 seconds + Average: 1.224 seconds + +NEW (channelless): + Run 1: 0.216 seconds + Run 2: 0.214 seconds + Run 3: 0.237 seconds + Run 4: 0.227 seconds + Run 5: 0.233 seconds + Average: 0.225 seconds + +IMPROVEMENT: 5.4x faster (82% reduction) +``` + +### 3. Rare Pattern Filtering +``` +Pattern: "connection_timeout" +Expected matches: ~87 lines + +OLD (channel-based): + Run 1: 0.402 seconds + Run 2: 0.442 seconds + Run 3: 0.414 seconds + Run 4: 0.406 seconds + Run 5: 0.477 seconds + Average: 0.428 seconds + +NEW (channelless): + Run 1: 0.106 seconds + Run 2: 0.099 seconds + Run 3: 0.103 seconds + Run 4: 0.104 seconds + Run 5: 0.105 seconds + Average: 0.103 seconds + +IMPROVEMENT: 4.2x faster (76% reduction) +``` + +### 4. Full File Read (DCAT) +``` +Operation: Read entire 50MB file +Expected output: 698,333 lines + +OLD (channel-based): + Run 1: 1.547 seconds + Run 2: 1.523 seconds + Run 3: 1.583 seconds + Run 4: 1.550 seconds + Run 5: 1.599 seconds + Average: 1.560 seconds + +NEW (channelless): + Run 1: 1.535 seconds + Run 2: 2.076 seconds + Run 3: 2.033 seconds + Run 4: 2.013 seconds + Run 5: 1.995 seconds + Average: 1.930 seconds + +PERFORMANCE: 19% slower (expected due to network protocol overhead) +``` + +## Performance Analysis + +### Key Insights + +1. **DGREP shows dramatic 4-5x performance improvements** with channelless mode +2. **Context lines benefit even more** (5.4x faster) due to reduced coordination overhead +3. **Performance gains are consistent** across different pattern match rates +4. **DCAT shows slight slowdown** due to protocol formatting overhead when outputting all lines +5. **Channelless mode excels** when filtering/processing reduces output volume significantly + +### Why Channelless is Faster + +The channelless architecture eliminates: +- **Goroutine coordination overhead** between file readers and output writers +- **Channel communication latency** for each line processed +- **Memory allocation/deallocation** for channel message passing +- **Context switching** between concurrent goroutines + +### Optimal Use Cases + +Channelless mode provides the biggest benefits for operations that: +- **Filter/reduce data volume** (grep patterns, context lines) +- **Process large files** with selective output +- **Require high throughput** for log analysis workloads + +### When NOT to Use Channelless + +The following operations continue to use channel-based processing: +- **Tail operations** (require continuous monitoring and real-time streaming) +- **MapReduce operations** (require aggregation infrastructure) +- **Operations outputting full files** (minimal filtering benefit) + +## Technical Implementation + +The channelless implementation introduces: +- **DirectProcessor framework** with LineProcessor interface +- **NetworkOutputWriter** for direct network streaming +- **Command-specific processors** (Grep, Cat, Tail, Map) +- **Intelligent mode detection** to choose optimal processing method + +## Conclusion + +The channelless implementation successfully delivers significant performance improvements for DTail's core use cases while maintaining full compatibility with existing functionality. The 4-5x speedup for grep operations represents a substantial enhancement for log analysis workflows.
\ No newline at end of file |
