# Auto-evo performance

**URL:** https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226
**Category:** Programming
**Created:** [January 19, 2026, 4:49pm UTC](https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226 "2026-01-19T16:49:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [January 19, 2026, 4:49pm UTC](https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226/1 "2026-01-19T16:49:33Z")

</div>

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.

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/7/729e12cb16abe6042bc55d049962165a8e9a6a11.png)

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/1/1c637c67a434ab279d3eda80a0295362c6ab62cf.png)

Unsurprisingly the mutation generation is the slowest thing.

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

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/3/3497336e221c27fbd3c01e413390291d98e40704.jpeg)

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

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/1/1bb3722a6079bf85fa068f23098506214990768d.png)

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

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/6/6942717c8c44922c1337a92a891376cc0c2b0b09.png)

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/b/bd30a3bcaa367caf315706e915b297961024c4f3.png)

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/5/52a9d4245ae836eb4e5f81424134146129fa0810.png)

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [January 20, 2026, 8:05am UTC](https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226/2 "2026-01-20T08:05:54Z")

</div>

> 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

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [January 20, 2026, 10:06pm UTC](https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226/3 "2026-01-20T22:06:04Z")

</div>

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:

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/0/0b3351132252a0273f80c817cc27ad45e16458d1.png)

> <https://github.com/Revolutionary-Games/Thrive/pull/6653>
>
> \*\*Brief Description of What This PR Does\*\*
> 
> This should give some noticeable a…uto-evo speed increases by purely tweaking the cache to use an apparently secret API that is just a faster dictionary lookup, and manually hashing a species score key (which should hopefully be resistant enough against any collisions).
> 
> \*\*Related Issues\*\*
> 
> 
> auto-evo being slow: https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226/2
> 
> 
> \*\*Progress Checklist\*\*
> 
> Note: before starting this checklist the PR should be marked as non-draft.
> 
> \- \[x\] PR author has checked that this PR works as intended and doesn't
> break existing features:
> https://wiki.revolutionarygamesstudio.com/wiki/Testing\_Checklist
> (this is important as to not waste the time of Thrive team
> members reviewing this PR)
> \- \[\] Initial code review passed (this and further items should not be checked by the PR author)
> \- \[\] Functionality is confirmed working by another person (see above checklist link)
> \- \[\] Final code review is passed and code conforms to the 
> \[styleguide\](https://github.com/Revolutionary-Games/Thrive/blob/master/doc/style\_guide.md).
> 
> Before merging all CI jobs should finish on this PR without errors, if
> there are automatically detected style issues they should be fixed by
> the PR author. Merging must follow our
> \[styleguide\](https://github.com/Revolutionary-Games/Thrive/blob/master/doc/style\_guide.md#git).

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [January 22, 2026, 4:19pm UTC](https://forum.revolutionarygamesstudio.com/t/auto-evo-performance/1226/4 "2026-01-22T16:19:46Z")

</div>

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:

> <https://github.com/Revolutionary-Games/Thrive/pull/6665>
>
> \*\*Brief Description of What This PR Does\*\*
> 
> Improved overall auto-evo performa…nce with caching performance improvements
> 
> Assuming the new cache keys do not hit into cache conflicts this should not have any impact on actual results as none of the algorithms were changed, just the way the caches are handled
> 
> \*\*Related Issues\*\*
> 
> 
> auto-evo getting slower, this should offset entirely: https://github.com/Revolutionary-Games/Thrive/pull/6563 
> 
> \*\*Progress Checklist\*\*
> 
> Note: before starting this checklist the PR should be marked as non-draft.
> 
> \- \[x\] PR author has checked that this PR works as intended and doesn't
> break existing features:
> https://wiki.revolutionarygamesstudio.com/wiki/Testing\_Checklist
> (this is important as to not waste the time of Thrive team
> members reviewing this PR)
> \- \[\] Initial code review passed (this and further items should not be checked by the PR author)
> \- \[\] Functionality is confirmed working by another person (see above checklist link)
> \- \[\] Final code review is passed and code conforms to the 
> \[styleguide\](https://github.com/Revolutionary-Games/Thrive/blob/master/doc/style\_guide.md).
> 
> Before merging all CI jobs should finish on this PR without errors, if
> there are automatically detected style issues they should be fixed by
> the PR author. Merging must follow our
> \[styleguide\](https://github.com/Revolutionary-Games/Thrive/blob/master/doc/style\_guide.md#git).

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:

> <https://github.com/Revolutionary-Games/Thrive/issues/6664>
>
> As they are meant to be reused so that reused caches in them can benefit from al…ready being a larger size containers. This should also hopefully help with memory management as well as there wouldn't be a bunch of temporary caches that are still allocated for the entire auto-evo run thus garbage collection is slower to remove them.

> <https://github.com/Revolutionary-Games/Thrive/issues/6663>
>
> Profiling auto-evo I've noticed that things like total hex count, movement speed…, rotation speed, and storage capacities take quite a significant portion of any auto-evo run. I think that if those were precalculated and updated in species OnEdited that would make things faster. One slight caveat here is that auto-evo might not be calling OnEdited after each organelle change, so that's the slightly tricky part to make sure auto-evo doesn't use outdated values when testing mutations.

* * *

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):

 ![image](https://thrivedevforum-uploads.b-cdn.net/original/2X/0/0b47a497ac8daec5dc1361c9044c6ba16265a325.png)
