1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
vcmi/lib
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
..
battle Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
bonuses Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
campaign Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
constants Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
events Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
filesystem Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
gameState Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
json Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
logging
mapObjectConstructors Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
mapObjects Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
mapping reorder fields to shrink struct TerrainTile from 96 to 80 bytes 2024-07-07 12:53:29 +00:00
minizip Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
modding Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
network Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
networkPacks Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
pathfinder Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
registerTypes Guest can also use & renaming 2024-05-01 15:58:22 +02:00
rewardable Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
rmg Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
serializer Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
spells Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
vstd Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
AI_Base.h
ArtifactUtils.cpp ArtifactPosition::TRANSITION_POS now is simple ArtSlotInfo 2024-05-17 14:59:51 +03:00
ArtifactUtils.h ArtifactPosition::TRANSITION_POS now is simple ArtSlotInfo 2024-05-17 14:59:51 +03:00
BasicTypes.cpp
BattleFieldHandler.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
BattleFieldHandler.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
CAndroidVMHelper.cpp
CAndroidVMHelper.h
CArtHandler.cpp Merge pull request #4025 from IvanSavenko/shared_ptr_lib 2024-05-30 19:14:06 +03:00
CArtHandler.h Merge pull request #4025 from IvanSavenko/shared_ptr_lib 2024-05-30 19:14:06 +03:00
CArtifactInstance.cpp
CArtifactInstance.h
CBonusTypeHandler.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
CBonusTypeHandler.h
CBuildingHandler.cpp
CBuildingHandler.h
CConfigHandler.cpp
CConfigHandler.h
CConsoleHandler.cpp Try to handle uncaught c++ exception on Windows and create crashdump 2024-06-06 20:08:48 +00:00
CConsoleHandler.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CCreatureHandler.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CCreatureHandler.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CCreatureSet.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CCreatureSet.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CGameInfoCallback.cpp Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
CGameInfoCallback.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CGameInterface.cpp Removed broken & unused serialization of player interface and AI 2024-05-17 16:35:53 +00:00
CGameInterface.h Removed broken & unused serialization of player interface and AI 2024-05-17 16:35:53 +00:00
CGeneralTextHandler.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CGeneralTextHandler.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CHeroHandler.cpp Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
CHeroHandler.h Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
CMakeLists.txt Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
Color.h
ConstTransitivePtr.h
CPlayerState.cpp
CPlayerState.h Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
CRandomGenerator.cpp
CRandomGenerator.h Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
CScriptingModule.cpp
CScriptingModule.h
CSkillHandler.cpp Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
CSkillHandler.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
CSoundBase.h Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
CStack.cpp
CStack.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CStopWatch.h
CThreadHelper.cpp Added changing thread name for FreeBSD 2024-05-12 15:10:29 +00:00
CThreadHelper.h
CTownHandler.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
CTownHandler.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
ExceptionsCommon.h Show error message on load if mod has broken creature instead of 2024-06-01 11:49:51 +00:00
ExtraOptionsInfo.cpp
ExtraOptionsInfo.h
FunctionList.h
GameCallbackHolder.h
GameConstants.h
GameSettings.cpp Small refactoring of adventure map spell casting: 2024-04-10 20:04:08 +03:00
GameSettings.h Small refactoring of adventure map spell casting: 2024-04-10 20:04:08 +03:00
IBonusTypeHandler.h
IGameCallback.cpp Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-21 12:58:36 +00:00
IGameCallback.h Do not check for guards when teleporting using means other than DD 2024-05-07 20:05:23 +00:00
IGameEventsReceiver.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
IHandlerBase.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
IHandlerBase.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
int3.h
Languages.h Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
LoadProgress.cpp
LoadProgress.h Fixes 2024-03-29 12:28:14 +02:00
LogicalExpression.cpp
LogicalExpression.h
MetaString.cpp artifact parts calc 2024-05-24 21:22:08 +02:00
MetaString.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
ObstacleHandler.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
ObstacleHandler.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
Point.h
Rect.cpp
Rect.h
ResourceSet.cpp
ResourceSet.h
RiverHandler.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
RiverHandler.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
RoadHandler.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
RoadHandler.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
ScopeGuard.h
ScriptHandler.cpp
ScriptHandler.h
StartInfo.cpp Implemented join room dialog 2024-04-23 17:15:59 +03:00
StartInfo.h Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
StdInc.cpp Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
StdInc.h Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
TerrainHandler.cpp lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
TerrainHandler.h lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
TextOperations.cpp
TextOperations.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
TurnTimerInfo.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
TurnTimerInfo.h Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
UnlockGuard.h
vcmi_endian.h
VCMI_Lib.cpp Removed non-functional updateEntity in VLC 2024-05-16 22:05:26 +00:00
VCMI_Lib.h Removed non-functional updateEntity in VLC 2024-05-16 22:05:26 +00:00
VCMIDirs.cpp Fix typos using https://github.com/crate-ci/typos 2024-06-24 03:47:19 +02:00
VCMIDirs.h