6 ms·
In C++, I’ve noticed that ChatGPT is fixated on unordered_maps. No matter the situation, when I ask what container would be wise to use, it’s always inordered_m
by lurquer 11mo ago
In C++, I’ve noticed that ChatGPT is fixated on unordered_maps. No matter the situation, when I ask what container would be wise to use, it’s always inordered_maps. Even when you tell it the container will have at most a few hundred elements (a size that would allow you to iterate their a vector to find what your are looking for before the unordered_map even has its morning coffee) it pushes the map… with enough prodding, it will eventually concede that a vector pretty much beats everything for small .size()’s.
- bmandale 11mo agoI agree with chatgpt here
- remexre 11mo agoisn't std::unordered_map famously slow, and you really want the hashmap from abseil, or boost, or folly, or [...]
- jcelerier 11mo ago> (a size that would allow you to iterate their a vector to find what your are looking for before the unordered_map even has its morning coffee) I don't know about this, whenever I've benchmarked it on my use cases, unordered_map started to become faster than vector at well below 100 elements