logoalt Hacker News

GnarfGnarftoday at 10:24 AM2 repliesview on HN

What, you rewrote std::deque? Whew!


Replies

wavemodetoday at 4:11 PM

Deque is one of the easier ones.

I echo the parent commenter - the STL has a massive negative impact on compile times. And for what? The STL is not even fast. The way the standards are written, std::unordered_map has to be implemented as a tree rather than a flat open-addressing hashtable, which would've been far superior due to cache locality.

For my own project I rolled my own string, string_view, map, set, optional, variant, and vector. Only took maybe a day. And that day has paid dividends, as my clean debug builds literally take 3 seconds now.

show 1 reply
spwa4today at 11:38 AM

Rewriting at least std::vector was a standard way to prep for a Google interview. And std::map if you wanted bonus points or a level up. Also, really interesting to do.