1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
vcmi/lib/mapping
K d3c198678c
reorder fields to shrink struct TerrainTile from 96 to 80 bytes
When I was playing a very large map, computer's turn took up to 2 minutes and that give me time to fire up perf and profile the code while waiting.

I noticed that 1.7% of time was spent in function CPathfinderHelper::getNeighbors and half of that on a single load from an array backing multi_array of TerrainTiles. That signals the CMap::terrain is too big to fit in CPU caches.

This patch reorders fields in TerrainTile struct, shrinking it from 96 bytes to 80 bytes and hopefully helping to keep more tiles in the cache and speeding things up a little bit.
2024-07-07 12:53:29 +00:00
..
CDrawRoadsOperation.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
CDrawRoadsOperation.h Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
CMap.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CMap.h Reindex objects to show interactive objects on top 2024-04-03 14:48:04 +02:00
CMapDefines.h reorder fields to shrink struct TerrainTile from 96 to 80 bytes 2024-07-07 12:53:29 +00:00
CMapEditManager.cpp Implemented configurable level of decorations for terrains 2023-12-22 17:41:30 +02:00
CMapEditManager.h Implemented configurable level of decorations for terrains 2023-12-22 17:41:30 +02:00
CMapHeader.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CMapHeader.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CMapInfo.cpp Refactoring of serialization versioning handling 2024-01-20 20:34:51 +02:00
CMapInfo.h Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
CMapOperation.cpp Reindex objects to show interactive objects on top 2024-04-03 14:48:04 +02:00
CMapOperation.h Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
CMapService.cpp Restrict reindexing to random maps 2024-04-03 20:05:35 +02:00
CMapService.h Moved serialization of ModCompatibilityInfo from MapFormat 2024-04-23 17:15:59 +03:00
MapEditUtils.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
MapEditUtils.h Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
MapFeaturesH3M.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
MapFeaturesH3M.h convert line endings from CRLF (Windows) to LF (Linux/Unix) 2023-10-19 16:23:21 +02:00
MapFormat.h Fix CI build 2023-05-31 23:18:39 +03:00
MapFormatH3M.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
MapFormatH3M.h Fixed loading of text strings for hota quests 2024-04-22 13:49:17 +03:00
MapFormatJson.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
MapFormatJson.h Moved json files to new directory, split on per-class basis 2024-02-14 13:08:24 +02:00
MapIdentifiersH3M.cpp Renamed JsonNode::meta to more logical modScope. Member is now private 2024-02-26 12:55:49 +02:00
MapIdentifiersH3M.h Improvements to type safety of Identifier class 2023-10-04 18:05:23 +03:00
MapReaderH3M.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
MapReaderH3M.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
ObstacleProxy.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
ObstacleProxy.h Allow filtering obstacles by faction aligmnment 2024-04-11 18:10:14 +02:00