Top
Best
New

Posted by mooreds 7 hours ago

Writing Rust code that's fast by asking agents to make the code faster(minimaxir.com)
90 points | 47 commentspage 2
Keats 6 hours ago|
As the author of Tera mentioned in the article, I am curious how it can get 2x faster. Was the benchmark using tera v2 with the `fast` feature enabled?
minimaxir 5 hours ago|
They were with tera 2.1.0, however using the default settings and not enabling the `fast` feature (which I did not know about, TIL).

The comparison benchmark results in the post were older and prior to further passes. After updating to tera 2.4.0 and enabling the `fast` feature set, I reran the benchmarks against the current codebase and the difference between my Rust crate and Tera is now about ~1.5x.

Some of the technical differences are (which in disclosure were surfaced by GPT 5.6 Sol): context and loop values are borrowed while Tera clones, cached static positions/lookups, less per-render heap setup, escaping chunks directly into the final String instead of bytes, and more granular bytecode functions which avoid stacks.

oever 4 hours ago||
Full type checking like in Askama and hot reloading of templates would be a great combination. Is that a feasible path with your project?
the__alchemist 4 hours ago||
Tangent: are "LLM" and "Agent" synonymous?
da_chicken 3 hours ago||
Not really. The LLM is the data model. The part doing the language manipulation. An agent is the combination of an LLM with an interface it knows how to use to take actions with, though it may just refer to the interface or connection or tool itself.

The LLM itself is primarily a transformer that handles tokenization, mapping, and neural-network reasoning (in simple terms). It's the engine. It takes in language, interprets it's meaning, and based on other language that supplies instructions, decides how to respond. The agent typically takes the form of an instruction for how to use a tool, combined with how to access it.

Technically, the chat session is itself an agentic tool because it's taking input and returning output through that interface. But it's kind of the default tool. Stdout, if you will.

Say you're in Gmail and you get a message that tells you about a meeting, but doesn't include an invite. If you tell Gemini to add an event for that meeting to your calendar, the LLM interprets your instruction, then uses an agent tool to read your email, interprets it, and then uses another agent tool to create a meeting on your Google Calendar.

minimaxir 3 hours ago|||
From an editing perspective, this went mostly down to a) attributing the change to a model rather than the harness and b) vibes.
bigfishrunning 4 hours ago||
In my mind no; an agent is an llm wrapped in more software (most trivially a while loop, but probably more then that)
eximius 3 hours ago||
Lot's of talk about how LLMs are bad at optimizing. And they are. They are still fundamentally semi-learned stochastic parrots. But LLMs are related to the Infinite Monkey Theorem - we've given monkeys typewriters, but pretrained the monkeys to be better than random.

They don't have to be good if they're cheap, directed, and sufficiently random to hit on something good within your budget.

Are LLMs better than our top mathematicians? No way! But they're able to spitball and falsify in parallel way faster. Eventually their directionally random output will hit something novel and interesting.

blackboxdev 4 hours ago||
[flagged]
pushpendraw 6 hours ago|
one thing nobody mentioned here, once the agent is looping against the same benchmark it will happily optimize for the benchmark itself and not the real workload. worth rerunning the win against a slightly different input shape after, just to check it did not memorize the harness instead of actually fixing anything.
petra 6 hours ago||
Maybe LLM's should be integrated with the software, so they could optimize to the real hardware and workload ?
minimaxir 6 hours ago||
There is an entire paragraph about benchmaxxing and how to mitigate that.