Efficio measurement-honest code optimisation
Python · one file · measured on a dedicated cloud machine

Make your code faster — and know that it actually is.

Give Efficio a Python file and the tests that exercise it. It rewrites the code, proves the rewrite still passes your tests, times both versions against each other on a machine doing nothing else, and hands back the improved file — with the evidence, and with the caveats.

It will also tell you when it found nothing. That is the point: a number you cannot trust is worse than no number.

How it works

Five stages. Nothing is guessed, and nothing is applied to your code without you.

1

It watches your tests run

Your file ships no benchmark, so Efficio runs your test suite once and records what it actually calls, with what arguments. That recording becomes the workload it times.

2

It proposes rewrites

A catalogue of transformations — hoisting work out of loops, replacing quadratic string building, turning membership tests into sets — is applied exhaustively, not sampled.

3

Your tests are the gate

Every candidate must pass your tests before anything is timed. A rewrite that changes an answer is thrown away for free, having cost no measurement at all.

4

It measures, carefully

Survivors are screened cheaply, then narrowed, then confirmed — the winner and the original interleaved on one quiet machine, so drift hits both arms equally.

5

You get a file and a verdict

The whole improved file, the diff, the measured numbers, and a judgement about whether the win is unqualified. You decide what to do with it.

Your code is never touched

Nothing is committed, pushed, or written back anywhere. The submission runs on a throwaway virtual machine that is destroyed when the job ends.

Why the number is worth quoting

Most "optimisers" report a speed-up. The interesting question is what would have to be true for that speed-up to be a lie — these are the answers.

  • Every number carries its resolution. A host can only see differences bigger than its own noise. If a rewrite is 0.3% faster on a machine that resolves 1%, that is reported as unresolved, never as a win.
  • One measurement at a time. Two benchmarks on one machine are each other's noise. Your job gets a machine to itself, which is why it takes minutes rather than seconds.
  • Correctness is decided before speed. The gate that runs your tests takes no timings, and the timer never runs on code that failed them.
  • Two axes, not one. Latency and memory are both reported. A rewrite that is 38% faster and allocates six times as much is not called a win — you are told, and you choose.
  • Work that disappears is caught. A rewrite that gets 20,000× faster usually means the compiler deleted the work. That is detected and refused rather than published.
  • "Found nothing" is a real answer. Efficio regularly searches and confirms nothing. It says so instead of manufacturing a number.

What the verdict means

Four outcomes. Only the first is an unqualified recommendation.

Adopted

Confirmed faster, larger than the machine could resolve, and better or neutral on memory. Take it.

Review

Confirmed faster, but with a caution attached — usually memory. Real, and yours to judge. You still get the file.

No change

It searched and confirmed nothing worth having. Common, and honest.

Could not measure

Nothing measurable was found — usually tests that never call the code, or call it on inputs too small to time.

A real result

A function building a string with += in a loop, submitted with a test that exercises it over 4,000 rows. Measured on one 8-core cloud machine.

Rewritejoin_string_concatenation
Latency38.59% faster
ConfidenceP = 1.000, confirmed
Host resolution0.29% — the win is 130× that
Memory586% worse
Verdictreview

Faster by a margin the machine can clearly see, and much hungrier for memory. A latency-only tool calls that an unqualified win. This one hands you both numbers and refuses to decide for you.

  def render_rows(rows):
      """Render rows as a newline-terminated block."""
-     out = ""
-     for row in rows:
-         out += row + "\n"
+     out = "".join(row + "\n" for row in rows)
      return out

Try it

Paste or upload a Python file and a test file that exercises it. Efficio needs the tests to call your code the way it is really used — on inputs big enough to time.

The standard library and pytest are available. Nothing is installed for your submission, so numpy, pandas or requests will not resolve. Your tests must exercise the code on realistic inputs — a function called twice with two items is too fast to measure, and will come back “could not measure”. Each run starts and destroys one real cloud machine, so expect to wait roughly ten minutes.

What it cannot do yet

Stated plainly, because a tool that hides its limits is asking you to find them in production.

  • Python only, one file at a time. Efficio also has JavaScript and C++ engines, but this page does not expose them.
  • No third-party packages. Your submission is not provisioned, so only the standard library and pytest are importable.
  • It optimises what your tests exercise. If your tests do not call the slow path, or call it on toy inputs, there is nothing to measure — and it will say so rather than guess.
  • Energy is reported, never optimised. It is modelled on this hardware, not metered, and is labelled as such.
  • A review verdict is not a recommendation. It is a measured result with a caution attached, handed to you because you are the one who knows whether the trade is acceptable.