logoalt Hacker News

pixelesque • yesterday at 9:58 PM • 1 reply • view on HN

Without wanting to be snarky, are the "hand optimized" C++ benchmark files mentioned on the benchmark page available anywhere, as the ones in the "bench/cpp/" directory don't look that optimized to me?

e.g. I see a general lack of reserve()s on strings and vectors (a few tests do use them a bit, like `graph` and `particles`), and there are several other things which I wouldn't personally call "optimized", so I assume those ones are the 'idiomatic' ones?

Same goes for the Rust code: a lot of the code seems to be using Vec::new() and String::new(), instead of ::with_capacity() which would optimize the memory re-allocation (reducing it as the containers/strings grow).


Replies

Aardappel • yesterday at 10:17 PM

Yes indeed, the real hand optimized files are private, the ones in the repo are decoys.

➕ show 2 replies