{"id":"7d361cf6-c5bd-4453-ae8e-89d9be795e5d","shortId":"Yzvv9J","kind":"skill","title":"145-java-refactoring-high-performance","tagline":"Use when you need to refactor Java code for high performance — including memory/allocation reduction, CPU hot-path optimization, and syntax/API/control-flow improvements. This should trigger for requests such as Review Java code for high performance; Optimize Java hot path; Reduc","description":"# Java rules for High Performance\n\nIdentify and apply practical Java high-performance techniques using a measure-first approach, with emphasis on allocation reduction, data layout, concurrency discipline, and evidence-based validation.\n\n**What is covered in this Skill?**\n\n- Measure-first workflow for Java code optimization\n- JVM/runtime-aware coding guidance\n- Allocation reduction techniques with bad/good patterns\n- CPU hot-path simplification and loop-level efficiency patterns\n- Concurrency/backpressure and timeout/cancellation discipline\n- I/O, parsing, and serialization efficiency patterns\n- Persistence/query and caching strategy guidance\n- Java-centric decision workflow: keep/revert based on measured impact\n\n**Scope:** Practical optimization in application code and APIs. Apply only where profiling indicates real bottlenecks.\n\n## Constraints\n\nPerformance optimization must be evidence-driven and safe, focused on Java code changes that preserve correctness and maintainability.\n\n- **MEASURE-FIRST**: Establish baseline behavior and identify Java code hot paths before optimization\n- **NO PREMATURE OPTIMIZATION**: Only optimize code paths identified by profiling evidence\n- **BEFORE APPLYING**: Read the relevant reference(s) for bad/good examples and measurement workflow\n- **EDGE CASE**: If hotspot evidence is unclear, ask clarifying questions before changing code\n\n## When to use this skill\n\n- Review Java code for high performance\n- Optimize Java hot path\n- Reduce Java allocations\n- Improve Java latency\n- Improve Java throughput\n\n## Workflow\n\n1. **Identify Java hotspot and baseline behavior**\n\nConfirm the performance-sensitive Java path and baseline behavior before changing code.\n\n2. **Select the relevant reference(s) by bottleneck**\n\nPick and read only the reference(s) matching the observed hotspot: `references/145-refactoring-high-performance-java-memory-allocation.md` for allocation pressure, primitives vs. wrappers, escape analysis, collection sizing, data layout, and deduplication; `references/145-refactoring-high-performance-java-cpu.md` for CPU-bound hot paths, bit-level parsing, branchless arithmetic, loop unrolling, Unsafe caution, and SIMD/vectorization; `references/145-refactoring-high-performance-java-code-syntax.md` for code shape, lambdas, API return conventions, parsing syntax, I/O strategy, concurrency, and control-flow improvements.\n\n3. **Apply targeted optimizations**\n\nImplement minimal, evidence-backed changes scoped to the chosen domain(s): memory/allocation, CPU/low-level, or code shape/control flow (and adjacent concurrency, I/O, and persistence/caching in Java code).\n\n4. **Validate and compare code-level outcomes**\n\nCompare before/after behavior and keep only Java code changes with meaningful, verified gains.\n\n## Reference\n\nFor detailed guidance, examples, and constraints, see:\n\n- [references/145-refactoring-high-performance-java-memory-allocation.md](references/145-refactoring-high-performance-java-memory-allocation.md)\n- [references/145-refactoring-high-performance-java-cpu.md](references/145-refactoring-high-performance-java-cpu.md)\n- [references/145-refactoring-high-performance-java-code-syntax.md](references/145-refactoring-high-performance-java-code-syntax.md)","tags":["145","java","refactoring","high","performance","cursor","rules","jabrena","agent-skills","ai-skills","claude","claude-code"],"capabilities":["skill","source-jabrena","skill-145-java-refactoring-high-performance","topic-agent-skills","topic-ai-skills","topic-claude","topic-claude-code","topic-claude-code-skills","topic-claude-code-subagents","topic-claude-skills","topic-cursor-agent","topic-cursor-ai","topic-cursor-skills","topic-cursorai","topic-github-copilot"],"categories":["cursor-rules-java"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/jabrena/cursor-rules-java/145-java-refactoring-high-performance","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add jabrena/cursor-rules-java","source_repo":"https://github.com/jabrena/cursor-rules-java","install_from":"skills.sh"}},"qualityScore":"0.642","qualityRationale":"deterministic score 0.64 from registry signals: · indexed on github topic:agent-skills · 384 github stars · SKILL.md body (3,243 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:54:18.666Z","embedding":null,"createdAt":"2026-05-07T12:55:05.492Z","updatedAt":"2026-05-18T18:54:18.666Z","lastSeenAt":"2026-05-18T18:54:18.666Z","tsv":"'1':251 '145':1 '2':271 '3':342 '4':373 'adjac':365 'alloc':70,98,243,292 'analysi':298 'api':147,329 'appli':54,148,201,343 'applic':144 'approach':66 'arithmet':317 'ask':220 'back':350 'bad/good':102,208 'base':79,136 'baselin':179,256,266 'before/after':382 'behavior':180,257,267,383 'bit':313 'bit-level':312 'bottleneck':154,278 'bound':309 'branchless':316 'cach':127 'case':214 'caution':321 'centric':132 'chang':169,224,269,351,389 'chosen':355 'clarifi':221 'code':14,38,93,96,145,168,184,194,225,233,270,326,361,372,378,388 'code-level':377 'collect':299 'compar':376,381 'concurr':74,336,366 'concurrency/backpressure':115 'confirm':258 'constraint':155,400 'control':339 'control-flow':338 'convent':331 'correct':172 'cover':83 'cpu':21,104,308 'cpu-bound':307 'cpu/low-level':359 'data':72,301 'decis':133 'dedupl':304 'detail':396 'disciplin':75,118 'domain':356 'driven':162 'edg':213 'effici':113,123 'emphasi':68 'escap':297 'establish':178 'evid':78,161,199,217,349 'evidence-back':348 'evidence-bas':77 'evidence-driven':160 'exampl':209,398 'first':65,89,177 'flow':340,363 'focus':165 'gain':393 'guidanc':97,129,397 'high':5,16,40,50,58,235 'high-perform':57 'hot':23,44,106,185,239,310 'hot-path':22,105 'hotspot':216,254,289 'i/o':119,334,367 'identifi':52,182,196,252 'impact':139 'implement':346 'improv':28,244,247,341 'includ':18 'indic':152 'java':3,13,37,43,47,56,92,131,167,183,232,238,242,245,248,253,263,371,387 'java-centr':130 'java-refactoring-high-perform':2 'jvm/runtime-aware':95 'keep':385 'keep/revert':135 'lambda':328 'latenc':246 'layout':73,302 'level':112,314,379 'loop':111,318 'loop-level':110 'maintain':174 'match':286 'meaning':391 'measur':64,88,138,176,211 'measure-first':63,87,175 'memory/allocation':19,358 'minim':347 'must':158 'need':10 'observ':288 'optim':25,42,94,142,157,188,191,193,237,345 'outcom':380 'pars':120,315,332 'path':24,45,107,186,195,240,264,311 'pattern':103,114,124 'perform':6,17,41,51,59,156,236,261 'performance-sensit':260 'persistence/caching':369 'persistence/query':125 'pick':279 'practic':55,141 'prematur':190 'preserv':171 'pressur':293 'primit':294 'profil':151,198 'question':222 'read':202,281 'real':153 'reduc':46,241 'reduct':20,71,99 'refactor':4,12 'refer':205,275,284,394 'references/145-refactoring-high-performance-java-code-syntax.md':324,406,407 'references/145-refactoring-high-performance-java-cpu.md':305,404,405 'references/145-refactoring-high-performance-java-memory-allocation.md':290,402,403 'relev':204,274 'request':33 'return':330 'review':36,231 'rule':48 'safe':164 'scope':140,352 'see':401 'select':272 'sensit':262 'serial':122 'shape':327 'shape/control':362 'simd/vectorization':323 'simplif':108 'size':300 'skill':86,230 'skill-145-java-refactoring-high-performance' 'source-jabrena' 'strategi':128,335 'syntax':333 'syntax/api/control-flow':27 'target':344 'techniqu':60,100 'throughput':249 'timeout/cancellation':117 'topic-agent-skills' 'topic-ai-skills' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-claude-code-subagents' 'topic-claude-skills' 'topic-cursor-agent' 'topic-cursor-ai' 'topic-cursor-skills' 'topic-cursorai' 'topic-github-copilot' 'trigger':31 'unclear':219 'unrol':319 'unsaf':320 'use':7,61,228 'valid':80,374 'verifi':392 'vs':295 'workflow':90,134,212,250 'wrapper':296","prices":[{"id":"3d8f477e-d07c-486f-bd16-a4558ffe2844","listingId":"7d361cf6-c5bd-4453-ae8e-89d9be795e5d","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"jabrena","category":"cursor-rules-java","install_from":"skills.sh"},"createdAt":"2026-05-07T12:55:05.492Z"}],"sources":[{"listingId":"7d361cf6-c5bd-4453-ae8e-89d9be795e5d","source":"github","sourceId":"jabrena/cursor-rules-java/145-java-refactoring-high-performance","sourceUrl":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/145-java-refactoring-high-performance","isPrimary":false,"firstSeenAt":"2026-05-07T12:55:05.492Z","lastSeenAt":"2026-05-18T18:54:18.666Z"}],"details":{"listingId":"7d361cf6-c5bd-4453-ae8e-89d9be795e5d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"jabrena","slug":"145-java-refactoring-high-performance","github":{"repo":"jabrena/cursor-rules-java","stars":384,"topics":["agent-skills","ai-skills","claude","claude-code","claude-code-skills","claude-code-subagents","claude-skills","cursor-agent","cursor-ai","cursor-skills","cursorai","github-copilot","intellij-idea","java","prompting","system-prompts"],"license":"apache-2.0","html_url":"https://github.com/jabrena/cursor-rules-java","pushed_at":"2026-05-18T13:53:37Z","description":"A curated and opinionated collection of Skills and Agents to be used in modern SDLC workflows for Java Enterprise development with your favorite AI Agent harness.","skill_md_sha":"6ffd91d754c7e509477de3ec3bbfbfc53409605c","skill_md_path":"skills/145-java-refactoring-high-performance/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/145-java-refactoring-high-performance"},"layout":"multi","source":"github","category":"cursor-rules-java","frontmatter":{"name":"145-java-refactoring-high-performance","license":"Apache-2.0","description":"Use when you need to refactor Java code for high performance — including memory/allocation reduction, CPU hot-path optimization, and syntax/API/control-flow improvements. This should trigger for requests such as Review Java code for high performance; Optimize Java hot path; Reduce Java allocations; Improve Java latency/throughput. Part of cursor-rules-java project"},"skills_sh_url":"https://skills.sh/jabrena/cursor-rules-java/145-java-refactoring-high-performance"},"updatedAt":"2026-05-18T18:54:18.666Z"}}