logoalt Hacker News

rfgplkyesterday at 9:39 PM2 repliesview on HN

If he is one of the devs between both libraries, why is there a performance gap? Why not port the optimizations from one lib to the other? You can even create a pinned agent workflow that automatically translates optimizations between repos. Fairly trivial to implement actually.


Replies

AlotOfReadingyesterday at 9:56 PM

Just because you can theoretically write equivalent code in both languages doesn't mean two idiomatic implementations in each language will be 1:1 with each other. I haven't looked at the code in question, but some examples of common differences:

A C++ program might do template metaprogramming at compile time and the same thing at runtime in Rust, or vice versa. The C++ version might use virtual functions that rust wouldn't use. The Rust version might simply give more optimization information to the backend. The C++ version might use fairly awful parts of the stdlib like iostreams or shared_ptr that rust simply implements better. Etc.

Or maybe they're just focused on the rust implementation as they should be.

show 1 reply
NewJazzyesterday at 9:43 PM

Because developers of security critical code don't flippantly merge LLM changes for marginal performance gain, and their time is incredibly valuable.