Skip to main content
idapt
HomeCodeAI ModelsPricing
Sign inStart free
  • Home
  • Pricing
  • AI Models
  • Image models
  • Voice models
  • Video models
  • Rankings
  • New models
  • Model status
  • Multi-Model Chat
  • Voice Mode
  • Voice HUD
  • Web Search
  • Image Generation
  • Video Generation
  • Audio Generation
  • Transcription
  • Drive
  • Credentials
  • Sharing
  • Workspaces
  • Tasks
  • Memory
  • Agents
  • Subagents
  • Automations
  • Skills
  • idapt Code
  • Code Execution
  • Computers
  • Computer Use
  • Computer Assist · Soon
  • Containers
  • Cloud Computers
  • Local AI
  • AI Gateway
  • API & SDK
  • CLI
  • MCP
  • Tunnels
  • All features →
  • LLM cost calculator
  • Token counter
  • Context window checker
  • Can I run it
  • Model picker quiz
  • Savings finder
  • Video cost estimator
  • Text to speech cost
  • Transcription cost
  • API endpoint tester
  • All free tools →
  • Blog
  • Use cases
  • Comparisons
  • Best of
  • Skills
  • Learn
  • Changelog
  • Help center
  • FAQ
  • Privacy
  • Compare all models
  • Support
  • idapt Code
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Downloads
  • Desktop
  • Badges and embeds
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)
All skills
Code

Speed up slow code

Profile first, then make the slow path measurably faster.

Fill it in

A function, endpoint, or script.

How much faster you need it.

x

Prove the result did not change.

Your prompt

Make [your what is slow] at least 10x faster.

PROFILE FIRST. Every instinct about where the time goes is wrong often enough
that acting on one without measuring is how an afternoon disappears into a loop
that was never hot. Show the profile, name the actual bottleneck, and only then
change anything.

Prefer the change that removes work over the change that does the same work
faster: an N+1 collapsed into one query beats a micro-optimized inner loop, and
a cache that is correct beats both.

Measure again after. Report before and after with the same method, and say what
the remaining bottleneck is, because there always is one.

Prove the output is unchanged. Run the existing tests, and if the function has
no test worth the name, write one that pins the current behaviour BEFORE you
optimize. Fast and wrong is a regression, not a win.
Use Speed up slow codeOpens with everything above already filled in.

Why this works

The whole skill is one instruction a model would otherwise skip: profile before changing anything. Asked to make code faster, it will optimize what looks slow, and what looks slow is reliably not where the time goes. It also prefers removing work to doing the same work faster, which is where the order-of-magnitude wins live, and it measures again afterwards with the same method so the number it reports is a comparison rather than a claim.

Questions

How does it know the output did not change?
It runs your tests, and if the code has none worth the name it writes one pinning the current behaviour before optimizing.

More code skills

  • idapt Code
  • Fix a failing test

Use it now in a chat in 1 click

Use Speed up slow code
Fix a GitHub issue
  • Find security bugs
  • Ship a feature
  • Untangle a god function