Outside Context Problem
2022 - General Optimisations

I'm sure I thought of more items for this page when lying in bed the other night, but this is what I can come up with at the moment...

Caching / Memoisation

I don't recall having used this in previous years, but I may be wrong. It did make a big difference to at least one puzzle this year.

The use cases I can think of (though there may well be more):

UPDATE: I have since optimised the solution for that puzzle, that the memoisation is no longer helpful, but at the point in time linked above, it made a difference.

Data Types

This is C# specific, though the collections can have similar/wildly different names across languages.

Compiler Hints

Again, C# specific though other languages might have equivalents. Sometimes (and I mean, not very often in my experience), the compiler hints for methods [MethodImpl(MethodImplOptions.AggressiveOptimization)] and/or [MethodImpl(MethodImplOptions.AggressiveInlining)] can speed things up. I'm guessing the fact that it only rarely helps is why the compiler doesn't do it all the time for everything.

Over the next few posts, I'll dive into some optimisations I discovered specific to particular puzzles. They will be in the order that they pop into my head...