MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003028VCMIAI - Adventure Mappublic2018-12-16 13:482018-12-30 20:41
ReporterWarmonger 
Assigned ToNullkiller 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.next 
Target VersionFixed in Version1.next 
Summary0003028: Optimize CGameInfoCallback::getPlayerTeam
DescriptionAccording to MSVS 2015 profiler, this little function uses 2% of all client time.

However, it has not much use, since player teams don't change often (if at all). Just make fixed player->team field.

Maybe update it only when player leaves the game, if ever.
TagsNo tags attached.
Attached Filespng file icon Issue 3028.png [^] (48,525 bytes) 2018-12-30 20:22

- Relationships

-  Notes
(0007698)
AVS (administrator)
2018-12-16 17:40

getPlayerTeam could be optimized, but problem is not in getPlayerTeam itself, but in that it is called way to often (mostly from tile visibility checks). AI should cache FoW map locally and do not retrive it from callback every time.
(0007701)
AVS (administrator)
2018-12-30 19:40

Optimized in https://github.com/vcmi/vcmi/pull/528 [^]
(0007702)
Warmonger (administrator)
2018-12-30 20:21
edited on: 2018-12-30 20:24

Indeed, but you actually had to optimize 2 different AI functions where this call is used, and the list is not exhaustive. At least these were 2 main callers.
(The lambda in the screenshot comes from ExplorationNewPoint())

(0007703)
AVS (administrator)
2018-12-30 20:41

See the PR, and my review. I`ve marked all known bottlenecks (I have profiler data too)

- Issue History
Date Modified Username Field Change
2018-12-16 13:48 Warmonger New Issue
2018-12-16 17:40 AVS Note Added: 0007698
2018-12-30 19:40 AVS Note Added: 0007701
2018-12-30 19:40 AVS Status new => resolved
2018-12-30 19:40 AVS Fixed in Version => 1.next
2018-12-30 19:40 AVS Resolution open => fixed
2018-12-30 19:40 AVS Assigned To => Nullkiller
2018-12-30 20:21 Warmonger Note Added: 0007702
2018-12-30 20:22 Warmonger File Added: Issue 3028.png
2018-12-30 20:24 Warmonger Note Edited: 0007702 View Revisions
2018-12-30 20:41 AVS Note Added: 0007703

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean