1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-28 22:13:21 +00:00
elsid 1e2aae8095
Use stable sort+unique to collect RefIDs for ESMStore records counting
The idea is to avoid std::map lookup for each CellRef. Instead generate a
sequence of added and removed RefNums into a vector then order them by RefNum
using a stable sort that preserves relative order of elements with the same
RefNum. RefIDs are stored in a different vector to avoid std::string move ctor
calls when swapping elements while sorting. Reversed iteration over added and
removed RefNums for each unique RefNum is an equivalent to what map-based
algorithm produces. The main benefit from sorting a vector is a data locality
that means less cache misses for each access. Reduces ESMStore::countRecords
perf cycles by 25%.
2021-05-15 18:45:22 +02:00
..
2021-04-30 19:39:26 +02:00
2021-04-30 20:11:41 +02:00
2021-05-12 10:34:40 +04:00
2021-04-30 20:49:22 +02:00
2019-04-28 18:21:31 -04:00
2016-12-15 13:09:40 +01:00
2021-04-11 14:46:51 +02:00
2021-01-26 22:29:41 +04:00