spears wrote:
How about creating a tree of FutureGameInfo objects once? On each simulation, walk the tree, initializing the objects on the outward traversal and summing the evs on the return. Would you have enough memory?
I'll give this a try. I've got 12gb of memory on my home computer and around 50gb using the university compute server. Working at home mostly so hopefully 12gb will do!
spears wrote:
Do you deal out cards in the simulation? If so, I think you should be able to get faster convergence by dealing out "strength buckets" in a way slightly reminiscent of CFRM.
Good idea, although I may look into it later though. The simulation and dealing of cards seems to run quite fast.
OneDayItllWork wrote:
I'm no Java expert, but I'd say work with structs, not objects. You want stuff on the stack, not the heap.
PolarBear wrote:
In Java the only things you can put on the stack are primitives (numerics, booleans) and references (pointers) to objects.
AFAIK java will do it's best with the objects when compiling, so not sure if i have much flexibility in regards to this.
I ran a few tests (last time I did so was quite a while ago) and found that I can get much better performance with kryo deep cloning.
Code:
20000 iterations -
Kryo serialisation: 2814.0ms
Cloner :22921.0ms
Improved java serialisation:13230.0ms
Kryo deep copy:2293.0ms
Not sure how I missed this when I last looked at the code. I'll let you know how it goes, hopefully i'll get a decent amount of iterations in now!