Find URL("...") allocations inside loops
Proprietaryjava.net.URL's constructor parses the URL string and dispatches through URLStreamHandlerFactory. Inside a loop that adds up — hoist URLs that don't change per iteration, or migrate to URI/HttpRequest builders.
org. openrewrite. kotlin. performance. FindURLConstructorInLoops$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. FindURLConstructorInLoops$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.