On Fri, 9 Dec 2016 07:36:13 +0100 "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net> wrote: > 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.
Actually I did not think the map display was calling canSee(), but it does, albeit only per Unit, not per Tile. That would be a good place for lock removal. AFAICT it is only contending with the main client thread that is processing updates from the server, but I could be wrong there. > I've read some people reporting a boolean array faster than a BitSet I have seen code where it was actually measured. However, that was several years ago in a Java version far away. New figures would be convincing. > (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. I think it is memory consumption that the Android folks are (rightly) much more worried about. More worried than us anyway (for now). > 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. Agreed that swapping a multiply for a memory lookup is probably faster. But no, I disagree that we *should* do this, *unless* it really is a problem *and* the new code is significantly faster. Neither of these conditions is clearly the case. > Okay, where's the exploration information maintained on server side ? On the server side every Tile contains a map of Player to player-view-of-the-Tile (Tile.cachedTiles). This is necessary so that if a player sees some map feature (e.g. a settlement), then loses sight of it, and then the feature changes (e.g. the settlement is destroyed), the server still has enough information to continue to inform the player about the *old* state of the tile, until such time as the player regains visibility of the changed tile. > Does the client only get explored tiles from server ? The client gets *everything* from the server. Unexplored tiles are skeletal (just id,x,y IIRC), other tiles are either the current full correct state of the tile including units (if visible to the player), or the last view of the tile (if not visible). Cheers, Mike Pope
pgp17F4vOBMTu.pgp
Description: OpenPGP digital signature
------------------------------------------------------------------------------ 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