I have some code that uses std::unordered_map. I’m considering rewriting it to use TMap.
I am wondering if anyone has done any comparisons between the performance of TMap and std::unordered_map. From my understanding, the std::unordered_map is slow because it uses a nasty linked list for buckets. So, rather cache unfriendly with stuff everywhere in RAM.
TMap uses a contiguous block of memory, so it should be more cache friendly. So, it should be fast, but how fast I wonder?
Maybe I’ll do my own benchmarks if no one else has any measurements. Google also has a crazy fast “swiss tables” hash map optimized for the CPU cache and SIMD.
This might be a tangent, but why would STL prevent cross-platform development? STL is literally the standard guaranteed to exist in all (compliant) C++ compilers… I get that you can’t expect the the same STL performance on all platforms, though…
More on-topic, though: Are you sure that unordered_map performance is actually an issue at all for you?
If you do measurements, please share them though, I would also be interested…
You aren’t able to mark that field as a UPROPERTY and any references to the AActors contained within the map will never be tracked and may be deleted if no one else has a reference to that actor.
Could you please point me to some other references and discussions about modern STL in games? STL is slowly getting more love now, so I am starting to be interested in it too. Would love to see some actual comparisons or issues besides its containers.
Maybe things have changed, but the reason why pretty much every C++ engine implement their own containers is because people got bitten in the past by using STL. The interface might be the same, but there’s no guarantee about the underlying implementation (specially when it comes to performance).