I had spent ages optimizing my maze solver ( https://github.com/VrIgHtEr/TheFarmerSolvedAMaze ). Meticulously going over which operations take how many ticks. But then the dev made a bunch of breaking changes and couldn't be bothered to rewrite everything.
Run an agent on it. This is what they excel at.