agentsclimarketplace

Measure before optimizing

Skill yuchi-chang/no-cape/skills/measure-before-optimizing

no-cape keeps the knowledge and drops the cape.

Install
npx -y skills add yuchi-chang/no-cape --skill measure-before-optimizing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when asked to improve performance, or when about to optimize code believed to be slow

SKILL.md

1.4 KB, as published. Nobody here has run it

Measure Before Optimizing

No optimization without a measurement. Intuition about where time goes is wrong often enough that acting on it produces complexity without speed.

The cycle

  1. Measure first. Profile, time, or count queries on a realistic workload. Find the actual hotspot — not the code that "looks slow".
  2. State the baseline. "X takes 2.3s, target is under 500ms." Without a number, nothing can be proven later.
  3. Fix the biggest cost first. It is usually structural — N+1 queries, O(n²) loops, missing index, repeated work inside a loop, chatty I/O — not micro-level (string concatenation, function call overhead).
  4. Re-measure the same workload. Report before/after numbers. Without them, the claim is just "I changed something".

Heuristics

  • Batching and killing N+1 patterns beat any micro-optimization by orders of magnitude.
  • Cache only with an invalidation story — a stale cache trades a speed problem for a correctness bug.
  • Don't trade readability for unmeasured gains; do trade it for a measured 10x.
  • Parallelism added "for speed" without measurement usually adds race conditions, not speed.

Red flags

"This should be faster", optimizing in the middle of an unrelated task, preemptive caching or parallelization. All of these mean: measure first, or leave it alone.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.