Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

high-performance-java

БесплатноБез исполняемых скриптовНе проверен

Use when writing, reviewing, or reshaping HotSpot Java where algorithmic complexity, data-structure choice, throughput, latency, allocation rate, zero-copy…

eclipse-rdf4jот eclipse-rdf4j★ 427 звёзд на GitHub

Об этом скилле

High-Performance Java

Use this skill for Java hot paths, algorithm-heavy Java, and JVM-side runtime specialization. Default bias: asymptotic win first, then the right execution model, then fewer allocations, fewer copies, less polymorphism, narrower code shape, stronger evidence.

HotSpot-only v1. Baseline assumptions:

  • repo baseline: JDK 21
  • current local runtime may be newer
  • low-level claims stay provisional until benchmark + JIT evidence agree
  • algorithm/data-structure claims stay provisional until they match the actual workload constraints
  • runtime codegen claims stay provisional until cold-start cost, warm steady-state behavior, and fallback behavior are all understood

Core loop

  1. Identify the workload shape and constraints.
  2. Pick the algorithm and data structure that change the slope.
  3. Decide whether the workload should stay interpreted, become vectorized/batched, or justify runtime specialization/code generation.
  4. Find the hot loop, hot call chain, or hot operator pipeline.
  5. Write the narrow fast path first.
  6. Push generic abstraction, materialization, and dispatch out of the loop.
  7. Benchmark before claiming improvement.
  8. Inspect HotSpot decisions before claiming JVM-level reasons.

Default coding bias

  • Prefer an algorithmic win over a micro win.
  • Prefer data structures that fit the operation mix, memory budget, and key domain.
  • Prefer the right execution model over reflexively adding code generation.
  • Prefer primitive-friendly layouts before boxed object graphs.
  • Prefer zero-copy over copy-transform-copy.
  • Prefer reuse over per-item allocation.
  • Prefer lazy traversal over full materialization.
  • Prefer primitives, flat arrays, and tight counted loops in hot paths.
  • Prefer monomorphic calls that inline away.
  • Prefer specialized lambda/adaptor code for the active workload.
  • Prefer one fast path plus one cold fallback over a single generalized hot path.
  • Prefer Janino only when generated Java can stay simple, code size can stay bounded, and compile cost can be amortized.

Hard rules

  • Do not micro-optimize a fundamentally wrong algorithm.
  • Do not defend a perf change with style arguments alone.
  • Do not claim “faster” without a measurement path.
  • Do not claim “JIT will optimize this” without checking inlining / compilation evidence.
  • Do not add a specialized library until you know what property it buys: fewer allocations, fewer copies, lower contention, off-heap layout, better primitive support, stronger compilation/runtime specialization, or a stronger algorithm.
  • Do not introduce Janino or other runtime codegen unless compile latency, cache keys, code-size limits, classloader lifetime, and fallback behavior are explicit.
  • Do not compile entire query plans blindly when only a subset of operators is hot or fusible.
  • Do not generate fancy modern Java syntax for Janino unless support is verified on the active Janino/runtime combination; conservative generated Java is the default.
  • Do not keep elegant-but-generic stream pipelines in verified hot loops.
  • Do not pay interface / visitor / wrapper overhead inside the hottest loop unless evidence shows it disappears.
  • Do not default to boxed Map<K, V> / Set<T> / List<T> shapes when primitive collections or flat arrays better fit the dominant path.

Design checklist

Ask these first:

  • What are N, Q, the update/query ratio, and the memory budget?
  • Is the main problem asymptotic complexity, cache locality, allocation pressure, branchiness, contention, I/O, or execution-model overhead?
  • What operation dominates: membership, counting, top-k, range query, join, shortest path, DP transition, parsing, encoding, filter/projection evaluation, aggregation, or tuple materialization?
  • Can the key/value/state space stay primitive or bit-packed?
  • Can the workload become offline, batched, sorted, prefix-based, vectorized, or compressed?
  • What allocates on the steady-state path?
  • What copies bytes, chars, arrays, or collections?
  • What materializes intermediate state that could stay streamed or cursor-based?
  • What dispatch stays virtual or megamorphic in the inner loop?
  • What loop shape blocks scalar replacement, inlining, or SuperWord vectorization?
  • What “generic” branch handles cases the active workload never uses?
  • How often will a generated shape execute, and can compile cost be amortized?
  • Can compiled artifacts be cached by normalized shape, types, nullability, and algorithm choice?
  • What is the fallback path for cold queries, oversized generated code, compile failure, or classloader churn?
  • What method-size, class-size, or constant-pool limits could the generated code hit?
  • Who owns generated classes, caches, and classloaders over time?

Workflow

0) Pick the algorithmic shape

  • Estimate the real workload: input size, query count, mutation pattern, latency target, and memory ceiling.
  • Choose the algorithm and data structure before tuning loop syntax.
  • Favor contiguous, cache-f
Полный SKILL.md на GitHub

Установить high-performance-java в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlreferences/advanced-coding-techniques.mdreferences/algorithms-data-structures.mdreferences/codegen-and-janino.mdreferences/coding-rules.mdreferences/evidence-workflow.mdreferences/high-performance-java-libraries.mdreferences/jdk-21-26-notes.md

FAQ

Что делает скилл high-performance-java?

Use when writing, reviewing, or reshaping HotSpot Java where algorithmic complexity, data-structure choice, throughput, latency, allocation rate, zero-copy, lazy evaluation, non-materialization, runtime specialization, query-engine code generation, Janino, primitive collections, performance libraries, intrinsics, SuperWord auto-vectorization, or C2 assembly matter. Also use for advanced algorithmic problem solving in Java, including dynamic programming, graph/range techniques, cache-aware code shape, and choosing between interpreted, vectorized, and compiled execution paths. Bias toward asymptotic wins first, then the right execution model, then specialized hot-path code, then benchmark and JIT evidence.

Как установить скилл high-performance-java?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл high-performance-java запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить high-performance-java с