On 25.12.2016 22:58, Michael T. Pope wrote: Hi,
> There is usually only zero, one, or two game objects (client + server). Are client and server both running in the same process ? In which ways do these two instances differ ? (code pointers appreciated :)) Another open question: what about the Specification class ? Can there be multiple instances at the same time ? > However there are some corner cases, and handling the places where the > client and server threads transition from having no game to having a new > game and communicating their state to the player threads, and then > subsequently clearing back to no game... well it is better than it was a > few weeks ago because I have been busy in that area but it is still > non-trivial. Beware also that in the longer term we hope to change things > so that the game currently shared by the server and the AI clients can be > distinct. Ah, AI players are basicly just usual players ? Could they, in theory, run in a different process, or on a different machine ? > As usual I have to ask what problem you are trying to solve? It sounds > like you are worried that the getGame calls are inefficient. Well, they probably do some overhead, as they seem to be called quite often, but I don't know much actually take. I'll yet have to find out, whether a) these functions get inlined b) they get jit-compiled at all (according to official docs, a method has to be called 1k times before jit gets active) c) references to long-lived objects or final refs also get inlined I'm not so confident w/ java profiling, so any tips appreciated. > Or indeed, imagine that you went ahead and turned all the game objects > into suitable singletons and accessed them that way, *and* measured the > difference --- let me speculate the gain would be *tiny* if anything as a > lot of those calls will be getting auto-inlined anyway. Does the inlining also happen on bytecode level - before jit gets active ? The reason for my question: according to the jre docs, methods have to be called 1k times before jit starts. > I am sorry I keep arguing with you, I really appreciate that you want to > improve the FreeCol codebase, but we need to put our effort into stuff > that is *broken*. Okay, which ones do you suggest ? --mtx ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Freecol-developers mailing list Freecol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freecol-developers