CompileStatic vs Runtime Metaprogramming: Latency vs Flexibility Under Concurrency
When a Groovy service receives a burst of concurrent requests, the first invocation of a method can trigger dynamic dispatch resolution. This resolution path uses the global MetaClassRegistry and per‑call‑site caching, which may introduce lock contention and latency spikes. Adopting @CompileStatic removes the dynamic dispatch overhead by emitting direct byte