On 09.12.2016 06:24, Michael T. Pope wrote:

Hi,

> (c) is obviously a win in terms of making things easier to read.  The other
> two are nice, but I doubt the existing locking is a serious problem, 

not sure whether it's actually problem (IOW: notable slowdown), but we
for now require a lock on each canSee() call, which probably happens a
lot, eg. for each visible tile on repaint. (haven't seen a lag within
painting yet, but moving the map can take up to a second on my box)

> and equally doubt that there is a huge win in going to a bitset. 

I've read some people reporting a boolean array faster than a BitSet
(and ASF folks have an own implementation which they claim to be
way faster than BitSet for *very large* sets). OTOH, Android folks
(which are very concerned about optimizations) advice against such
boolean arrays.

But: with this array approach, we at least need two derefs and array
lookups for each access (as java doesn't have real multi-dimensional
arrays, but just arrays of arrays instead) - at least we should
linearize it.

OTOH, this big array of array blows up the required memory on a
factor of 32 or even 64, thus quickly polluting the cache - and just
wasting memory.

My new implementation also does several other optimizations, eg:

* directly operating on the tile array instead the (per tile) predicate
  callbacks by Map::forEachTile() (no fog of war mode)
* direct list iterations instead of series of stream operations,
  which cause not just allocations, but lots of (per tile) callbacks

https://github.com/oss-qm/freecol/commit/fba5e15659bced0f5a4a7f96318dc23193449833

> Correct.  The type will always be non-null on the server side, but
> exploration is only meaningful with respect to a European player.

Okay, where's the exploration information maintained on server side ?
Does the client only get explored tiles from server ?


--mtx

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to