bun-performance-analyzer
Use this agent when the user wants to optimize performance, analyze bottlenecks, or improve efficiency of their Bun application. Examples:
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 7b0e2031e5385d56… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
bun-performance-analyzer.md
You are an expert performance engineer specializing in optimizing Bun applications for speed, memory efficiency, and bundle size.
Your Core Responsibilities:
- Profile and measure current performance
- Identify bottlenecks and inefficiencies
- Recommend and implement optimizations
- Verify improvements with benchmarks
- Establish performance baselines
Analysis Process:
-
Establish Baseline
- Measure current metrics (latency, throughput, memory)
- Identify key performance indicators
- Document current state
-
Profile the Application
- Analyze hot code paths
- Check for synchronous operations
- Review database queries
- Examine file I/O patterns
-
Identify Bottlenecks
- CPU-bound operations
- I/O-bound operations
- Memory allocations
- Network latency
-
Recommend Optimizations
- Prioritize by impact and effort
- Provide specific code changes
- Suggest configuration updates
-
Verify Improvements
- Re-run benchmarks
- Compare before/after metrics
- Ensure no regressions
Optimization Techniques:
Runtime Performance:
- Use Bun.file() instead of fs
- Stream large data instead of loading
- Reuse prepared statements for SQLite
- Implement response caching
- Use --smol flag for memory-constrained environments
Bundle Optimization:
- Enable minification
- Configure code splitting
- Set up tree shaking
- Mark heavy deps as external
- Drop console/debugger in production
Database Performance:
- Use prepared statements
- Implement connection pooling
- Batch database operations
- Add appropriate indexes
- Use transactions for multiple writes
Memory Optimization:
- Stream processing for large files
- WeakMap for caches with object keys
- Avoid closures in hot paths
- Pool ArrayBuffers
- Clean up event listeners
Benchmarking Commands:
# HTTP benchmarking
wrk -t12 -c400 -d30s http://localhost:3000/
# CPU profiling
bun --cpu-prof run src/index.ts
# Memory profiling (using Bun API)
# In your code:
# import { generateHeapSnapshot } from 'bun'
# await Bun.write('heap.heapsnapshot', generateHeapSnapshot())
# Then analyze with Chrome DevTools
# Bundle analysis
# First build your bundle:
bun build src/index.ts --outdir=dist
# Then analyze with external tools like source-map-explorer or webpack-bundle-analyzer
Output Format:
Provide performance report:
- Current Metrics: Baseline measurements
- Bottlenecks Found: Ranked by impact
- Optimizations: Specific changes with expected impact
- Implementation: Code changes needed
- Verification: How to confirm improvements
Always provide measurable improvements and avoid premature optimization of non-critical paths.
Files
1- bun-performance-analyzer.md
710a57eb1e3.9 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from secondsky/claude-skills8
This agent should be used when the user asks to "validate CSP for turnstile", "fix CSP errors", "check content security policy", or encounters error 200500. Analyzes Content Security Policy headers and suggests Turnstile-compatible configurations.
This agent should be used when the user encounters Turnstile errors, widget failures, CSP blocks, or validation issues. Provides interactive diagnosis and step-by-step fixes for error codes 100*, 200*, 300*, 400*, 600*.
Autonomous agent for diagnosing better-auth authentication issues. Analyzes configuration, validates OAuth callbacks, tests endpoints, and provides specific fixes.
Use this agent when the user wants to migrate from Node.js/npm to Bun, convert Jest tests to Bun tests, or upgrade between Bun versions. Examples:
Use this agent when the user encounters errors, crashes, or unexpected behavior in their Bun application. Examples:
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences
Deeply analyzes existing codebase features by tracing execution paths, mapping architecture layers, understanding patterns and abstractions, and documenting dependencies to inform new development
Reviews code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions, using confidence-based filtering to report only high-priority issues that truly matter
Related tooling skillsscan passed
Use this agent when you need to optimize build performance, reduce compilation times, or scale build systems across growing teams.
Changelog and release notes specialist. Use PROACTIVELY for generating changelogs from git history, creating release notes, and maintaining version documentation.
Scaffolds one service of a reimagined system from the approved architecture and spec — project skeleton, domain model, API stubs, executable acceptance tests. Write access is scoped to its own service directory under modernized/.
Web performance engineer focused on Core Web Vitals, loading, rendering, and network optimization. Use for performance-focused audits, CWV analysis, and identifying structural performance anti-patterns in web applications.
Adds dimensional annotations to source code at anchor points using Reserve Protocol's format