Home / Web & Dev / Coding & Code Review

Performance Pass on Working Code: Speed, Memory, Scale

Reviews code that already works through a performance engineer's eyes, aiming at speed, memory and scalability: finds bottlenecks, wasteful logic and unnecessary re-renders, then returns the issues, the strategies and the optimized code.

performanceoptimizationmemoryre-renders
Role: you are a performance engineer.

Code: [paste the code]

Optimize this code with three targets: speed, memory use and scalability. Look for bottlenecks, inefficient logic and re-renders that are not needed.

Deliver:
- The performance issues you found
- The optimization strategies
- The improved code
More in Coding & Code Review
Build a Project While the AI Coaches Your Developer SkillsNewCoding & Code ReviewTurns the AI into a mentor during a build: it spots gaps in your understanding, quizzes your reasoning, gives short explanations when needed and suggests small exercises based on the project, so you finish it as a better developer.
Project: [project]

While you help me build this project, keep doing the following the whole time:
- Notice where my understanding has gaps.
- Ask me questions that put my reasoning to the test.
- Give me short, focused explanations whenever I need them.
- Suggest small exercises drawn from what we are building.

The aim: I do not just finish the project, I also come out of it as a better developer.
Clarify, Compare Architectures and Plan Before Any CodeNewCoding & Code ReviewMakes the AI act as a senior architect: it questions your requirements and assumptions, compares 2-3 architectures on scalability, complexity and speed, recommends one, then splits the system into modules with data flow before any code is written.
Role: you are a senior software architect and my AI coding partner.

Project: [project]

Do not write any code yet. Go through these steps first:

Step 1 — Clarify
- Question me in detail on the requirements, the constraints, the expected scale and the edge cases.
- Push back on any assumption that is vague or weak.

Step 2 — Design
- Put forward 2-3 candidate architectures.
- Compare them on scalability, complexity and how fast they can be delivered.
- Recommend one of them and explain your reasoning.

Step 3 — Plan
- Split the system into components or modules.
- Define what each one is responsible for and how data flows between them.

Start the implementation only once we have agreed on the plan. The principle: think first, code later.
Context-Aware Code Built Around Your Goal, Users, Stack and LimitsNewCoding & Code ReviewGives the AI your project's goal, users, stack and constraints, then has it surface hidden risks, pick the approach that fits that context rather than the trendy one, and write code tied to it with short explanations of key decisions.
Role: you are the AI engineer dedicated to my project.

What you need to know about the project:
- Objective: [goal]
- Who will use it: [target users]
- Stack: [stack]
- Limits: [time, cost, scale]

Task:
1. Study this context in depth.
2. Point out constraints or risks that are not obvious.
3. Recommend the approach that best fits this context, which is not necessarily the most popular one.
4. Write code that follows this context strictly.
5. Briefly explain the main decisions you made.

Do not fall back on generic patterns: every choice must reflect the context above. If it is not clear which part to build first, ask me.
Four-Agent Engineering Team: Architect, Engineer, Reviewer, OptimizerNewCoding & Code ReviewSimulates four collaborating agents on one coding task: an architect designs the system, an engineer builds it, a reviewer checks quality and an optimizer tunes performance, ending with the architecture, implementation, review feedback and final optimized version.
Act as four agents working together on the task below.

Task: [describe what to build]

Roles:
- Architect: designs the system
- Engineer: builds it
- Reviewer: checks the quality
- Optimizer: does a performance pass

Deliver, in this order:
1. Architecture
2. Implementation
3. Review feedback
4. Final optimized version
Refactor Code into Clean Architecture Without Changing BehaviorNewCoding & Code ReviewConverts your code to clean architecture as a senior engineer would: separates concerns, raises modularity and lowers coupling while behavior stays identical, returning the new folder structure, an architecture description and the refactored code.
Role: you are a senior engineer moving this code to a clean architecture.

Code: [paste the code]

Goals:
- separate the concerns
- make it more modular
- reduce coupling

Constraint: the behavior does not change; only the structure gets better.

Deliver:
- The new folder structure
- A description of the architecture
- The refactored code