Auto-evo performance

Auto-evo has recently gotten some upgrades that have made it slower. So unfortunately the amount of feedback about auto-evo taking a long time has increased. And I’ve also personally noticed that I’m waiting more for auto-evo runs if I’m testing things in freebuild.

So as I couldn’t find the other latest profiling info, here’s some fresh profiling results from master branch version. These are with JetBrains tracing profiler using a single background thread running 1 world to generation 15. Which took in total a long time (and is the reason why I ran just one world).

Interestingly in the results as much time was logged in Godot GUI stuff than auto-evo though then again I ran with 2 threads: one main and one background where auto-evo was running so that makes sense to me.

Here’s the results when scoped purely to the executor thread.

Unsurprisingly the mutation generation is the slowest thing.

Get pressure score is not very surprising that it is the most expensive method:

Having more efficient cache than Dictionary<(Species, SelectionPressure, Patch), float> would help:

For completeness here’s the rest of the pressure score parts if anyone has thoughts on improving any of them:

2 Likes

I tested disabling the score cache and I think that that makes auto-evo performance worse, so there is at least some cache usage of the score, it just takes really long to check the cache

I ran 5 tests with the cache and 5 without. In one case the fastest run was without a cache, but at the same time 3 of the other cache-less runs were a minute slower than the slowest run with the cache

1 Like

Apparently I can’t resist late night coding so I overhauled the score dictionary key and switched to an apparently faster method of reading a dictionary, and now the pressure score spends quite negligible time in dictionary lookups:

1 Like

As some auto-evo new changes basically undid my efficiency findings, I did a second set of cache tuning and now all caches that were useless should be removed and I increased the efficiency of the remaining ones:

With that I got the best auto-evo run set that I’ve seen in a while:

  • 1:03
  • 0:37
  • 1:52
  • 1:55
  • 1:45

I’m for now done trying to squeeze more performance out so I opened some issues about TODO comments in auto-evo efficiency related things that are still not done:


Finally here’s the latest measurements (though I did still have 2 caches to enable after this, but this should be relatively close to what’s going on):

2 Likes