There’s been a thread earlier this year about auto-evo performance, but I want to discuss a more specific project here.
I will note that there is now also a separate Github project to handle auto-evo optimisation. And a lot of other work to optimise auto-evo is currently happening (since I started writing this, actually).
For a while now, there’s been a consensus that the current auto-evo method of making a full clone of species for every mutation attempted is wasting a lot of memory. This causes problems on systems with limited memory available, and may slow down auto-evo as a whole. As far as I am aware, there are also two proposals to handle this.
As:
- I suspect further additions to the auto-evo system will just make attempting this more difficult.
- Any kind of performance improvement at all for auto-evo would be greatly appreciated to:
- Ensure further Multicellular additions do not bloat waiting times.
- Allow more species in parallel so that prokaryote, eukaryote and Multicellular Species can actually all exist in parallel instead of one dominating.
- Even after moving to Macroscopic in the near future, we probably will still use a system related to this for Macroscopic auto-evo.
I think this may be a good time to attempt this architectural change.
The proposals I have seen, as I understand them:
- Hhyyrylainen has often suggested switching to a system where “auto-evo is only allowed to work with readonly species + a mutation list wrapper and never directly modify species.”
- @Gamedungeon has suggested that we look at immutable data structures, designed so when you clone them it only stores the changes and links back for everything else.
For the first option I at least know that the first step would be to ensure all the auto-evo calculations use ReadOnly interfaces. However, those ReadOnly interfaces themselves are not always set up with the best memory allocation efficiency. So those would likely also have to be updated. For example the ReadOnly interfaces do not allow using indexes to iterate in a loop over organelles as:
“implementing that for facade classes would be difficult. The only way it would work with good performance is that on first index call after each modification it would need to generate a list of organelles to use indexing on. Right now it avoids that by just creating a single enumerator instance instead.”
So this would likely have to be updated as well.
I do not yet have a good grasp on what the second option would entail in a practical sense.
The objective of this post is to keep track of the discussion thus far, and not let it be lost in Discord mentions that nobody ever sees again. Please let me know if I misunderstood or missed anything.
I also hope that we can come to some consensus on what should be done so that anyone who is interested in working on this has some idea of what to do to complete the plan. So any suggestions on that front are more than welcome.