Java perf check
Skill limited-grisaille833/claude-java-plugins/plugins/java-quality/skills/java-perf-check
Quick Java performance scan flagging N+1 queries, memory issues, threading problems, and algorithmic hotspots. Use when user asks to "check performance", "performance scan", "any N+1 queries", "performance issues", "is this efficient", or "slow code".From its SKILL.md
npx -y skills add limited-grisaille833/claude-java-plugins --skill java-perf-checkAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.0 KB, 655 tokens by cl100k_base, as published. Nobody here has run it
/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/forEachloop @OneToManyor@ManyToManywithoutfetch = FetchType.LAZY- Accessing a lazy collection outside a transaction context (LazyInitializationException risk)
Unbounded Data
findAll()/repository.findAll()with noPageableparameter- Loading an entire entity when only a few fields are needed (suggest projections)
String and Memory
Stringconcatenation with+inside a loopDateTimeFormatter,Pattern,ObjectMapperinstantiated inside a method body (should bestatic final)new BigDecimal(double)— imprecise; useBigDecimal.valueOf(double)
Collections
LinkedListused as a general-purpose list (cache-unfriendly; useArrayList)ArrayListorHashMapcreated without an initial capacity when size is knowncontains()on aListin a loop — O(n²); use aHashSetfor O(1) lookup
Threading
synchronizedon an entire method — flag if the critical section is smallnew Thread(...)created directly — recommendExecutorServiceor@Async- Shared
HashMap— recommendConcurrentHashMap - Java 21+:
synchronizedinside virtual-thread code — pinning risk; recommendReentrantLock
Transaction Scope
@TransactionalwithoutreadOnly = trueon read-only service methods- HTTP calls, file I/O, or
Thread.sleep()inside a@Transactionalmethod
Step 3 — Output
## Performance Scan — [scope]
🔴 HIGH [count] (likely production impact)
🟡 MEDIUM [count] (noticeable under load)
🔵 LOW [count] (minor optimisation)
### Findings
[For each finding:]
[Severity] [Category] — [ClassName]:[line]
Problem: [one sentence + estimated impact]
Fix:
Before: [code]
After: [code]
### Top 3 Impact Actions
1. [highest gain fix]
2. [second]
3. [third]
Step 4 — Next Steps
- For a full performance deep-dive → use the
java-performance-revieweragent - For JPA-specific issues → run
/java-jpa - To measure real hotspots → enable Hibernate stats:
spring.jpa.properties.hibernate.generate_statistics=true - For production profiling → Spring Boot Actuator + Micrometer:
/actuator/metrics
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.