unclad5968 a day ago

Why does the STL use such a poor implementation? It says it's performance is due to chasing pointers and allocating/freeing each node individually. Are stl implemented not able to change the details due to backwards compatibility?

  • variadix a day ago

    The use of chaining and the requirement of pointer stability are written into the standard. Changing the implementation to do something else would require changing the standard, which would change the API contract, which would break existing code.

    • beached_whale 12 hours ago

      I think Boost::unordered_map is a drop in replacement, but I think it is the breaking of existing code part. Not that they couldn't pop that behind an ABI flag.

    • cozzyd 12 hours ago

      Yeah but they could add a better one with a different name (std::dict?)