Find Gson() allocations inside loops

Proprietary

Gson's default constructor builds the type-adapter registry up front. Allocating one per loop iteration repeats that work — hoist a single Gson instance to a top-level property.

org.openrewrite.kotlin.performance.FindGsonInLoops$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.performance.FindGsonInLoops$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.