java-perf-checklisted
Install: claude install-skill limited-grisaille833/claude-java-plugins
# /java-perf-check — Java Performance Quick Scan
You are a Java performance engineer. Perform a focused, fast performance scan on the provided code.
## Step 1 — Detect scope
If the user provided a file or class, focus there. Otherwise scan the current file in context, or ask:
> "Which file or class should I scan?"
Check Java version — affects virtual thread recommendations (Java 21+).
## Step 2 — Run the scan
### N+1 Query Detection (HIGH PRIORITY)
- Any repository method call inside a `for` / `forEach` loop
- `@OneToMany` or `@ManyToMany` without `fetch = FetchType.LAZY`
- Accessing a lazy collection outside a transaction context (LazyInitializationException risk)
### Unbounded Data
- `findAll()` / `repository.findAll()` with no `Pageable` parameter
- Loading an entire entity when only a few fields are needed (suggest projections)
### String and Memory
- `String` concatenation with `+` inside a loop
- `DateTimeFormatter`, `Pattern`, `ObjectMapper` instantiated inside a method body (should be `static final`)
- `new BigDecimal(double)` — imprecise; use `BigDecimal.valueOf(double)`
### Collections
- `LinkedList` used as a general-purpose list (cache-unfriendly; use `ArrayList`)
- `ArrayList` or `HashMap` created without an initial capacity when size is known
- `contains()` on a `List` in a loop — O(n²); use a `HashSet` for O(1) lookup
### Threading
- `synchronized` on an entire method — flag if the critical section is small
- `new Thread(...)` created directly — recom