Receber por email
← Voltar para o catálogo

claude-java-plugins

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".

15estrelas
Atualizado há 6 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add ducpm2303/claude-java-plugins

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/claude-java-plugins-mpsy13k5/svg)](https://www.skillteca.com.br/skills/claude-java-plugins-mpsy13k5)

Skills relacionadas

Ver todas de Desenvolvimento →

Alerta por categoria

Receba novas skills de Desenvolvimento toda segunda

1 email curto, só com as skills novas de Desenvolvimento. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

/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 — recommend ExecutorService or @Async
  • Shared HashMap — recommend ConcurrentHashMap
  • Java 21+: synchronized inside virtual-thread code — pinning risk; recommend ReentrantLock

Transaction Scope

  • @Transactional without readOnly = true on read-only service methods
  • HTTP calls, file I/O, or Thread.sleep() inside a @Transactional method

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-reviewer agent
  • 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
Compartilhar X LinkedIn