TheStarport / FLHook

A Server Improvement for Freelancer.
GNU General Public License v3.0
30 stars 16 forks source link

Widespread use of std::map instead of std::unordered_map #324

Closed Aingar closed 9 months ago

Aingar commented 1 year ago

std::map search complexity is O(log n), whereas std::unordered_map is O(1). Crude test proved that even in very small collections (five elements), unordered_map wins by a factor of 2.

A widespread conversion into unordered_map for performance reasons should be conducted, and std::unordered_map should be available without further imports everywhere in the codebase.

Aingar commented 9 months ago

Fixed for core in 495ce610a55d7024131adc89e32038dce44af9ef Plugins will be done when they're rewritten for the next release.