I’m seeing some very strange timing behavior with large entity validators using Dart. I am using the Stopwatch class to time my evaluations and break out of my genetic algorithm loop. It resets to 0 at the beginning of each “main” loop. It works fine for all validators except the “Hundreds of entities.” With this validator I have to end my loop at 60ms to avoid a timeout. This is crazy, because I know that it doesn’t take 40ms to do an evaluation, return the last result and print it out. I have counted dozens or hundreds of evaluations before the 60ms hits. But it seems to be a regular issue with that validator. I can’t find any infinite loops or other weird cases. Has anyone else seen timing issues like this?
Hey @Mixolyde,
Using Dart regular here I haven’t seen anything like this.
Which puzzle are you referring to?
At the moment I get it in Hypersonic and Smash the Code. I think it has to do with garbage collection and how much memory I am generating with my various search techniques. It looks like the cleaning up of memory at the end of the while loop is going over the timeout. Any tips on how to minimize object creation or state creation would be appreciated. I’m going to try some kind of beam search that keeps fewer states in memory at a time.