ChatGPT Prompt for Bug Fixing
Optimize startup time performance in Go with profiling, benchmarking, and targeted improvements.
More prompts for Bug Fixing.
Diagnose and resolve dependency conflicts, version mismatches, and peer dependency issues in any package manager.
Analyze concurrent code for race conditions, deadlocks, and timing bugs with detection strategies and fixes.
Analyze code for memory leak patterns, identify allocation issues, and generate detection and fix strategies.
Guide a structured incident response with root cause analysis, mitigation steps, and post-mortem documentation.
Comprehensive code review guide focused on error handling for Go projects.
Comprehensive code review guide focused on async patterns for Java projects.
You are an expert optimization specialist with deep expertise in system optimization. Optimize the performance of startup time in a Go application. **Focus area:** startup time **Language:** Go **Performance goal:** cut memory usage in half **Current pain point:** The startup time is too slow and needs optimization ## Performance Assessment Framework ### Step 1: Measure Current Performance - Key metrics to capture for startup time (latency, throughput, memory, CPU) - Profiling tools specific to Go and how to use them - How to set up reproducible benchmarks - Baseline measurement methodology (percentiles: p50, p95, p99) ### Step 2: Identify Bottlenecks - Common performance bottlenecks in Go startup time - How to read and interpret profiler output - Flame graph analysis for CPU-bound issues - Memory allocation analysis for memory-bound issues - I/O analysis for network or disk-bound issues ### Step 3: Optimize (Ordered by Impact) Provide 10 optimization techniques for startup time in Go, ordered from highest to lowest impact: For each technique: 1. What it optimizes and expected improvement range 2. Implementation approach (describe the code changes needed) 3. Trade-offs (complexity, readability, maintainability) 4. When NOT to use this optimization 5. How to measure the improvement ### Step 4: Validate Improvements - A/B testing approach for performance changes - Load testing methodology and tool recommendations - Regression testing to ensure functionality is preserved - Production monitoring to verify improvements under real load ## Go-Specific Performance Tips - Runtime-specific optimizations (JIT, GC tuning, memory model) - Library and framework-specific performance tricks - Build-time optimizations (tree shaking, minification, AOT compilation) - Caching strategies at every layer ## Performance Budget - Define performance budgets for startup time - Set up automated performance regression detection - Create a performance dashboard with key metrics - Establish a review process for performance-impacting changes - Use precise technical terminology appropriate for the audience - Include code examples, configurations, or specifications where relevant - Document assumptions, prerequisites, and dependencies - Provide error handling and edge case considerations Present as numbered steps. Each step should have: a clear action title, detailed instructions, expected outcome, and common pitfalls to avoid.