Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
An AI assistant suggests that replacing a for-loop with Array.reduce will improve performance. What should happen before this suggestion is trusted and shipped?
💻 Code Challenge | +75 XP
Write a prompt that provides real CPU profile data (as a described paste) and asks the AI to interpret it and generate a tinybench comparison for a suggested optimization, rather than asking a vague "why is this slow" question.
A team merged an AI-suggested "performance optimization" without benchmarking it, and it turned out to make the code measurably slower at production data scale. Reorder the steps that should have caught this before merging.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Asking an AI assistant to diagnose why code is slow without providing any actual profiling or benchmark data
// Low value: an unverified guess
"Why is this endpoint slow?"
// High value: grounded in REAL data
"Here's the actual CPU profile [paste]. What does it show?"The Solution //
Without real data, the AI can only produce a plausible-sounding but fundamentally unverified guess based on reading the code, which may or may not reflect the actual bottleneck — the same "measure first" discipline that applies to human-led performance work applies identically to AI-assisted work.
The Error //
Merging an AI-suggested performance optimization without benchmarking it against realistic data first
// Wrong: shipped on faith, never verified
// (AI suggestion merged directly, no benchmark run)
// Correct: verified before trusting it
bench.add("original", original); bench.add("suggested", suggested);
await bench.run(); // confirm it ACTUALLY helps before mergingThe Solution //
An AI-suggested optimization is a hypothesis about what might improve performance, not a verified fact — a specific JavaScript engine's actual optimization behavior can be subtle and counter to common assumptions, meaning a suggestion that sounds plausible can turn out to make performance worse, especially at a different data scale than assumed.