Find expensive allocations inside collection lambdas
ProprietarySearch-only recipes that flag heavyweight allocations sitting inside the trailing lambda of a map / filter / forEach / flatMap call. Each such lambda runs once per element — the same allocation-cost profile as a loop body.
org. openrewrite. kotlin. performance. FindAllocationsInCollectionLambdas$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. FindAllocationsInCollectionLambdas$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.
Recipe list
It runs these recipes, in this order.
- Find
Regexallocations inside collection lambdas - Find
Pattern.compilecalls inside collection lambdas - Find
String.formatcalls inside collection lambdas - Find
LoggerFactory.getLoggercalls inside collection lambdas - Find Jackson
ObjectMapper()allocations inside collection lambdas - Find
Gson()allocations inside collection lambdas