On Mon, 14 Jul 2014 14:37:37 -0600
William Astle <l...@l-w.ca> wrote:
> It looks like the biggest culprit is the screen repaint process. That 
> calls MapViewer.getUnitInFront() which uses Tile.getDefendingUnit() 
> which then uses getDefencePower(). It looks like this is determining the 
> strongest unit on the tile.

OK, that makes sense.  Thanks for tracking that down.

> This is probably not easily solvable without 
> some sort of caching of the situation or maintaining a list of units 
> that is sorted by strength at each tile.

That is probably relatively easy.  A Tile is a UnitLocation which
already maintains a list of units.  All we have to do is insert in order
in UnitLocation.add.  Moves may be common, but still much rarer than map
painting so this is likely to be a win, even for REF mega-stacks of doom
(they may be unusually large, but are unlikely to contain more than 4
distinct defence strengths).

Cheers,
Mike Pope

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to