performance

performance is a cursor rule for Cursor from jakerains/CitrusRules. It costs 3,449 tokens per session, scanned A, original, MIT.

A performance-focused development rule set for measuring software speed, finding bottlenecks, choosing optimizations, and checking the results.

In plain words
What is it for?
Use it when establishing a baseline, profiling code, optimizing algorithms or components, and measuring whether a change helped.
Why use it?
It discourages guessing where code is slow and requires changes to be compared with measurements.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when establishing a baseline, profiling code, optimizing algorithms or components, and measuring whether a change helped.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/jakerains/citrusrules/performance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/jakerains/CitrusRules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for performance

README.md
[![agentmods](https://agentmods.dev/badge/rules/jakerains/citrusrules/performance/github.svg)](https://agentmods.dev/rules/jakerains/citrusrules/performance)
Your own site
<a href="https://agentmods.dev/rules/jakerains/citrusrules/performance"><img src="https://agentmods.dev/badge/rules/jakerains/citrusrules/performance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for performance

Your own site · 80×15
<a href="https://agentmods.dev/rules/jakerains/citrusrules/performance"><img src="https://agentmods.dev/badge/rules/jakerains/citrusrules/performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,449 This file is loaded in full into every session.
When invoked 3,449 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03449 $0.03449
Opus 5.5 $0.01380 $0.01380
Sonnet 5.5 $0.00690 $0.00690
Haiku 4.5 $0.00345 $0.00345

Measured 2mo ago against content hash 6a9e2d711f11, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

performance scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url, {
templates/performance.mdc · 516 lines

How it starts

The opening of the file, as written. The whole thing — 516 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Performance Optimization Standards

Implement performance-first development practices with systematic optimization strategies, efficient algorithms, and comprehensive monitoring. This rule ensures all code follows performance best practices from the ground up.

Performance Analysis Methodology

Before implementing any feature, I will:

  1. Baseline Measurement: Establish current performance metrics before changes
  2. Bottleneck Identification: Use profiling tools to identify actual performance constraints
  3. Impact Assessment: Evaluate the performance impact of proposed changes
  4. Optimization Strategy: Choose appropriate optimization techniques based on analysis
  5. Validation: Measure improvements after implementation

Core Performance Implementation Patterns

1. React Component Optimization Template

Use this pattern for all React components:

import { memo, useMemo, useCallback, useState, useEffect } from 'react';

interface OptimizedComponentProps {
  items: Array<{ id: string; name: string; score: number }>;
  filters: FilterOptions;
  onItemSelect: (id: string) => void;
  onBulkAction: (ids: string[]) => void;
}

export const OptimizedComponent = memo<OptimizedComponentProps>(({ 
  items, 
  filters, 
  onItemSelect, 
  onBulkAction 
}) => {
  // Memoize expensive computations
  const processedItems = useMemo(() => {
    return items
      .filter(item => matchesFilters(item, filters))
      .sort((a, b) => b.score - a.score)
      .slice(0, 100); // Limit initial render
  }, [items, filters]);

  // Memoize event handlers to prevent child re-renders
  const handleItemSelect = useCallback(
    (id: string) => () => onItemSelect(id),
    [onItemSelect]
  );

  const handleBulkSelect = useCallback(
    (selectedIds: string[]) => {
      onBulkAction(selectedIds);
    },
    [onBulkAction]
  );

  // Virtualization for large lists
  const [visibleRange, setVisibleRange] = useState({ start: 0, end: 50 });

  return (
    <VirtualizedContainer
      itemCount={processedItems.length}
      onRangeChange={setVisibleRange}
    >
      {processedItems.slice(visibleRange.start, visibleRange.end).map(item => (
        <MemoizedListItem
          key={item.id}
          item={item}
          onSelect={handleItemSelect(item.id)}
        />
      ))}
    </VirtualizedContainer>
  );
}, (prevProps, nextProps) => {
  // Custom comparison for complex props
  return (
    prevProps.items.length === nextProps.items.length &&
    shallowEqual(prevProps.filters, nextProps.filters)
  );
});

// Memoized child component
const MemoizedListItem = memo<{
  item: ListItem;
  onSelect: () => void;
}>(({ item, onSelect }) => (
  <div onClick={onSelect} className="list-item">
    <span>{item.name}</span>
    <span className="score">{item.score}</span>
  </div>
));

Read the full file on GitHub · 516 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 516 lines · 3,449 tokens per session scan A 6a9e2d711f11

Subscribe to this mod's changes

performance is a cursor rule published in the GitHub repository jakerains/CitrusRules (2 stars, last pushed 1y ago), licensed MIT. It adds 3,449 tokens to every session, about $0.0138 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.