In my case, an IO-520D, which is a high compression engine (8.5 to 1), detonation is a consideration.
It is wise to take off and climb with the Exhaust Gas Temperatures between 1250 and 1300 degrees.
This range will result in the best combination of power produced and temperature control of the Cylinder Heads.
What I did to get an idea of where to adjust the mixture for takeoff, for example at 5000', was at 5000' slow to 60Kts, apply full power, takeoff RPM, and adjust the mixture to achieve 1250 to 1300 degrees, and note the approximate position of the mixture.
So now when I am departing a high altitude airport, I have an idea where to put the mixture, so it will only take a minor adjustment while taking off to achieve adequate power and CHT control (1/2", 5/8", etc).
I also use the 1250 to 1300 EGT climbing at a reduced RPM and full throttle. In this engines case between 2550 and 2750 RPM where Takeoff RPM is 2850.
Another example if you don't have an engine analyzer, and for a high compression engine, is with full power note what your Maximum EGT is while leaning at say 5000', then subtract 200 to 250 degrees and use that as a target for best power and cooling for takeoff.
I am by no means an expert, but the engine in my plane is the most important part so I treat it like I want it to get me home!
I also believe the best money spent on an airplane is an engine analyzer, whether Carbureted or Fuel Injected.
Especially if Fuel Injected!
Get one and learn how to use it

You won't regret it.
My $.03.... adjusted for inflation

Mark