163-java-profiling-refactor

Solid

Use when you need to refactor Java code based on profiling analysis findings — including reviewing docs/profiling-problem-analysis and docs/profiling-solutions, identifying specific performance bottlenecks, and implementing targeted code changes to address CPU, memory, or threading issues. This should trigger for requests such as Refactor the code with profiling; Apply profiling; Refactor the code with profiling; Optimize hot path. Part of cursor-rules-java project

Code & Development 393 stars 78 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 92/100

Stars 20%
86
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Java Profiling Workflow / Step 3 / Refactor code to fix issues Implement refactoring based on profiling analysis: review profiling-problem-analysis-YYYYMMDD.md and profiling-solutions-YYYYMMDD.md, identify specific performance bottlenecks, and refactor code to fix them. Ensure all tests pass after changes. **What is covered in this Skill?** - Review analysis notes: docs/profiling-problem-analysis-YYYYMMDD.md, docs/profiling-solutions-YYYYMMDD.md - Identify specific bottlenecks from the documented findings - Refactor code to address CPU hotspots, memory leaks, threading issues, or other performance problems - Run verification: ./mvnw clean verify or mvn clean verify **Scope:** Changes must pass all tests. Apply fixes incrementally and verify after each significant change. ## Constraints Verify that changes pass all tests before considering the refactoring complete. - **MANDATORY**: Run `./mvnw clean verify` or `mvn clean verify` after applying refactoring - **SAFETY**: If tests fail, fix issues before proceeding - **BEFORE APPLYING**: Read the analysis and solutions documents for specific recommendations - **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes - **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance ## When to use this skill - Refactor the code with profiling - Apply profiling - Refactor the code with profiling - Optimiz...

Details

Author
jabrena
Repository
jabrena/cursor-rules-java
Created
1 years ago
Last Updated
today
Language
Java
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

164-java-profiling-verify

Use when you need to verify Java performance optimizations by comparing profiling results before and after refactoring — including baseline validation, post-refactoring report generation, quantitative before/after metrics comparison, side-by-side flamegraph analysis, regression detection, or creating profiling-comparison-analysis and profiling-final-results documentation. This should trigger for requests such as Verify performance fix; Verify the performance; Verify the memory; Verify the threading. Part of cursor-rules-java project

393 Updated today
jabrena
Code & Development Solid

145-java-refactoring-high-performance

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

393 Updated today
jabrena
Data & Documents Solid

162-java-profiling-analyze

Use when you need to analyze Java profiling data collected during the detection phase — including interpreting flamegraphs, memory allocation patterns, CPU hotspots, threading issues, systematic problem categorization, evidence documentation with profiling-problem-analysis and profiling-solutions markdown files, or prioritizing fixes using Impact/Effort scoring. This should trigger for requests such as Analyze JFR profile; Analyze the profile; Analyze the performance; Analyze the memory. Part of cursor-rules-java project

393 Updated today
jabrena
Code & Development Solid

141-java-refactoring-with-modern-features

Use when you need to refactor Java code to adopt modern Java features (Java 8+) — including migrating anonymous classes to lambdas, replacing Iterator loops with Stream API, adopting Optional for null safety, switching from legacy Date/Calendar to java.time, using collection factory methods, applying text blocks, var inference, or leveraging Java 25 features like flexible constructor bodies and module import declarations. This should trigger for requests such as Review Java code for modern Java development; Apply best practices for modern Java development in Java code. Part of cursor-rules-java project

393 Updated today
jabrena
AI & Automation Solid

161-java-profiling-detect

Use when you need to set up Java application profiling to detect and measure performance issues — including automated async-profiler v4.0 setup, problem-driven profiling (CPU, memory, threading, GC, I/O), interactive profiling scripts, JFR integration with Java 25 (JEP 518, JEP 520), or collecting profiling data with flamegraphs and JFR recordings. This should trigger for requests such as Improve the code with profiling; Apply Profiling; Refactor the code with profiling; Add profiling support. Part of cursor-rules-java project

393 Updated today
jabrena