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.
Five stages. Nothing is guessed, and nothing is applied to your code without you.
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.
A catalogue of transformations — hoisting work out of loops, replacing quadratic string building, turning membership tests into sets — is applied exhaustively, not sampled.
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.
Survivors are screened cheaply, then narrowed, then confirmed — the winner and the original interleaved on one quiet machine, so drift hits both arms equally.
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.
Nothing is committed, pushed, or written back anywhere. The submission runs on a throwaway virtual machine that is destroyed when the job ends.
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.
Four outcomes. Only the first is an unqualified recommendation.
Confirmed faster, larger than the machine could resolve, and better or neutral on memory. Take it.
Confirmed faster, but with a caution attached — usually memory. Real, and yours to judge. You still get the file.
It searched and confirmed nothing worth having. Common, and honest.
Nothing measurable was found — usually tests that never call the code, or call it on inputs too small to time.
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.
| Rewrite | join_string_concatenation |
|---|---|
| Latency | 38.59% faster |
| Confidence | P = 1.000, confirmed |
| Host resolution | 0.29% — the win is 130× that |
| Memory | 586% worse |
| Verdict | review |
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
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.
Stated plainly, because a tool that hides its limits is asking you to find them in production.
pytest are importable.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.