3 ms·
What, you rewrote std::deque? Whew!
by GnarfGnarf 4mo ago
What, you rewrote std::deque? Whew!
- spwa4 4mo agoRewriting 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.
- wavemode 4mo agoDeque 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.
- drivebyhooting 4mo agoUnordered map is a hash map with separate chaining.