Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Zero-Allocation Java Review for Hot Paths

    1

    Reviews Java hot paths (render, tick, simulation loops) for heap allocations: cost model, reuse patterns, JFR methodology — no cargo-cult pooling

    Free

    Security scanned
    Zero-Allocation Java Review for Hot Paths

    Zero-Allocation Java Review for Hot Paths

    Example session with this skill installed

    Review this market data handler for allocations — it runs on every tick: <paste MarketFeedHandler.java>

    • Read your context and instructions
    • Compiled the zero-allocation java review

    Findings

    #SeverityLocationFinding
    1HIGHhandle(), new VenueParserParser built per tick — hoist to a cached field
    2HIGHvenue loopfor (Venue v : venues) allocates an iterator — indexed loop
    3MEDtoQty()Double.valueOf boxing on the hot path — primitive double path
    4LOWvenue guardUnknown venue ids dropped silently — counter + rate-limited log

    Fix sketch (Finding 1)

    private final VenueParser parser = new VenueParser(); // owner-confined scratch, reused every tick
    

    Methodology

    jdk.ObjectAllocationSample (10 ms threshold) over a 5-minute soak. Findings 1-2 confirmed by TLAB churn in the profile; Finding 3 is a boxing pattern flagged by inspection, verify with the same event; Finding 4 is correctness, not allocation.

    Next steps

    • Apply fixes 1-2, re-run the soak, compare allocation rate
    • Finding 4: decide the policy for unknown venues before release

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A code-review skill for Java hot paths: render loops, tick and simulation code, per-element loops. It hunts heap allocations that drive GC pressure — with a cost model, not cargo cult.

    What it does

    • Checklist of allocation sites: boxing, implicit iterators, string concatenation, per-element new, vector-math temporaries
    • Reuse patterns reference: cached scratch fields, dest-argument APIs, ThreadLocal buffers, object pools — each with rules and anti-patterns (pooling everything, micro-caching mutable results)
    • JFR methodology: what to measure before recommending a fix, and when escape analysis already removes the allocation for free
    • Report format ranks findings by real cost and honestly marks claims unverified without a profile
    • Sample review of a MarketFeedHandler included

    Born in the hot paths of a real voxel engine render loop.

    Focuses only on hot paths (frame/tick/message loops). Ignores startup, UI, and error paths. Requires external profiling data (JFR/async-profiler) for maximum accuracy.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 22 days ago

    • Free with an Agensi account

    Permissions

    Read Files
    Listed22 days ago

    What's inside

    Frequently Asked Questions

    This skill identifies both explicit and implicit heap allocations in high-frequency code—such as autoboxing, iterator churn, and string concatenation—which are the primary causes of unpredictable Garbage Collection (GC) pauses and latency spikes.

    It is designed for high-frequency code blocks like render loops, tick-based physics engines, and high-throughput messaging handlers where every millisecond counts and GC-related frame drops are unacceptable.

    The skill is compatible with any AI agent that supports Java source code analysis and can be integrated into your existing CI/CD pipeline or used as a standalone auditing tool during the profiling phase.

    You will receive the specialized logic for identifying allocation patterns, a checklist of low-level optimization strategies, and a structured reporting template to document findings and recommended rewrites.

    While generic models often recommend 'clean' abstractions like Streams or Lambdas, this skill is specifically tuned to reject those patterns in favor of zero-allocation, primitive-heavy alternatives required for high-performance systems.

    Because high-performance Java is an evolving field, this skill is updated periodically to include new patterns for modern JDK versions (such as Project Loom or Vector API considerations) and new findings from the game-dev and HFT communities.

    New in Code Quality & Review