// Master plugin performance optimization including profiling, benchmarking, caching, and resource management. Use when optimizing slow operations.
| name | optimization-techniques |
| description | Master plugin performance optimization including profiling, benchmarking, caching, and resource management. Use when optimizing slow operations. |
// Lazy initialization
lazy val resource: Database by lazy {
Database.connect()
}
// Caching
private val cache = mutableMapOf<String, Result>()
fun getResult(key: String) =
cache.getOrPut(key) { compute(key) }
// Concurrent operations
val results = ids.map { async { fetch(it) } }.awaitAll()
✓ Agent response < 500ms ✓ Command execution < 1s ✓ Memory footprint < 50MB ✓ Startup time < 2s ✓ CPU idle < 1%