At some point, every programmer becomes a detective, murderer and mainly a victim of his own codebase.
When I started working on AVD, it was really simple. User moved a slider which triggered ammo component update. That's it. It was really simple system. Few updates later I added guns. Well, guns need ammo as dependency. I did not want to regenerate ammo each time I rebuilt the gun so I started to cache components.
Each new feature seemed reasonable in isolation. Together they slowly transformed the original design into something it was never intended to support. Fast forward to the current alpha. Vehicles can contain arbitrary component hierarchies: armor plates, turrets, wheels, weapons, and more. The original caching system is somehow still alive, but it has accumulated a lot of baggage along the way.
Since turrets appeared, the system forms sort of a tree of registered components. This hiearchy is based on string paths. Yes, you hear it right. We got "stringly" typed trees. If I want to rename vehicle, I need to rename pretty much everything not to break these string references. Terrible. The real nodes have their own hiearchy which needs to be synced with the registry. It was a really odd system. Game kept crashing because of intricate bugs that were easy to introduce. Chaos has won.
Over the last few weeks I have been untangling that mess. Some parts were worth keeping. Others were relics from earlier versions of the game and no longer served a purpose. Large portions of the system were removed entirely.
The result is a much simpler generation pipeline that better reflects what the game has become rather than what it was originally supposed to be. It is easier to understand, easier to maintain, and noticeably more stable.
Sometimes the best optimization is to delete code.