Optimizer

Algorithmic rewrites,
not just micro-opts.

ACENLY doesn't add caching or swap libraries. It finds a fundamentally better algorithm — O(n²) to O(n) — then proves it works on your actual data.

Download preview →

Early access · Interface preview available · All platforms planned

Example optimization — deduplicate_users()

Before — O(n²)
def deduplicate_users(users):
    seen = []
    result = []
    for user in users:
        if user['id'] not in seen:
            seen.append(user['id'])
            result.append(user)
    return result

# list.append + "in" scan = O(n²)
# 395 ms at n=10,000
After — O(n)
def deduplicate_users(users):
    seen = {}
    result = []
    for user in users:
        uid = user['id']
        if uid not in seen:
            seen[uid] = True
            result.append(user)
    return result

# dict lookup = O(1) per item = O(n)
# 4.98 ms at n=10,000 ✓ identical output
79.26× faster Pure Python · Standard library only · Identical output on all test cases · O(n²) → O(n)
The product
A full local optimizer. Not a script.

Dashboard, results viewer, live output — everything runs on your machine.

1
Paste your function. Hit optimize.
Choose Safe, Balanced, Aggressive or Max. Watch the engine work in real time.
ACENLY — local optimizer Dev Mode — Unlimited
INPUT
Paste Python code here — or click 📂 Open file to load from disk…
LIVE OUTPUT ● Balanced
Run output will appear here…
⚡ Optimize
Safe
Balanced
Aggressive
Max
Screenshot · Optimize UI
2
See the winner — with proof.
Speedup, original vs winner code, full benchmark comparison, raw log.
ACENLY — Results
RUNS
find_top_k_frequent
68c38ccb · input.py 1.63×
find_top_k_frequent
0e753ce8 1.57×
find_top_k_frequent
1b9a5c3a 1.50×
find_top_k_frequent
1.63×
completed
from collections import Counter

def find_top_k_frequent(words, k):
    counts = Counter(words)
    sorted_words = sorted(counts, key=lambda w: (-counts[w], w))
    return sorted_words[:k]
Screenshot · Results viewer
3
Track everything across functions and runs.
Dashboard shows all your functions, best speedups, full run history.
ACENLY — Dashboard
24
TOTAL RUNS
3
FUNCTIONS
15
WINS
1.67×
BEST SPEEDUP
0
APPLIED
find_top_k_frequent 1.67×
Runs 20 · Wins 15 · Last run 25 Jun
find_duplicates
Runs 1 · Wins 0 · Last run 24 Jun
is_prime
Runs 3 · Wins 0 · Last run 24 Jun
Screenshot · Dashboard
How the optimizer works
Not a magic box. A disciplined process.
1

AST Analysis

ACENLY parses your function's abstract syntax tree, identifies the complexity class, and maps data structures being used.

2

Evolution Engine

Generates a population of candidate rewrites using an LLM. Tests them against each other in tournament rounds — survivors breed the next generation.

3

Oracle Coordinator

An LLM coordinator observes what strategies are working and directs the engine toward promising directions — no random searching.

4

Correctness Check

Every candidate is run against your test cases. Outputs must be identical. If they're not, the candidate is discarded — speed without correctness is worthless.

5

Benchmark Proof

The winning function is benchmarked head-to-head against the original using the same statistical rigor as the benchmark tool. The speedup you see is real.

6

Clean Output

You get back pure Python. By default, rewrites use the standard library only — no new dependencies. Dependency policy is configurable if your project allows more.

What it works on
Any function with a measurable runtime.

Works best on CPU-bound functions with deterministic output. Not suited for I/O-heavy code.

Data deduplication Search & lookup Aggregation Graph traversal String manipulation Sorting & ranking Set operations Frequency counting Nested loops Matrix operations
FAQ
Common questions.
Every candidate is verified to produce identical output on your test cases before it's accepted. We also run the full benchmark to confirm the speedup is real. That said, we recommend reviewing the output yourself before deploying — the tool is a collaborator, not a replacement for engineering judgment.
Your code never leaves your machine. The optimizer runs locally using your own LLM API key. We never see your code.
Your own API key — Together AI, OpenAI, or local models via Ollama. Typical cost per optimization job: €0.04–0.10 on Together AI.
Typically 5–15 minutes depending on the function complexity and the number of candidates generated. The engine runs multiple generations of candidates and benchmarks all of them rigorously.