@MickyD None of the answers in those Meta questions support your assertion/conclusion that "questions about
code optimisations are off-topic". That Code Review might be a better place to ask an optimization question does not mean Stack Overflow is a bad or unacceptable place to ask the same question. Though this question, in its current state, might be lacking or even off topic due to missing code/details, that the end-goal is optimizing code I don't think is enough, by itself, to make it off topic. —
Lance U. Matthews 42 secs ago