Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2360 closed defect (fixed)

Speed up territory computation

Reported by: mimo Owned by: mimo
Priority: Should Have Milestone: Alpha 16
Component: Core engine Keywords:
Cc: Patch:

Description

The function CCmpTerritoryManager::CalculateTerritories() is pretty inefficient for adding different grids.

Running with callgrind the initialisation and the first 10 turns (callgrind crashed after that), CalculateTerritories() is the main time consummer (in term of proper time) with 3% of the total as seen in the png attached. The simple patch added reduces it by nearly a factor 2 as seen in the afterPatch png.

Attachments (3)

beforePatch.png (365.3 KB ) - added by mimo 10 years ago.
afterPatch.png (176.7 KB ) - added by mimo 10 years ago.
grid.diff (1.3 KB ) - added by mimo 10 years ago.

Download all attachments as: .zip

Change History (5)

by mimo, 10 years ago

Attachment: beforePatch.png added

by mimo, 10 years ago

Attachment: afterPatch.png added

by mimo, 10 years ago

Attachment: grid.diff added

comment:1 by mimo, 10 years ago

Owner: set to mimo
Resolution: fixed
Status: newclosed

In 14530:

Improve speed of territory computation, fixes #2360

comment:2 by mimo, 10 years ago

Milestone: BacklogAlpha 16
Note: See TracTickets for help on using tickets.