there are ifs, I don't see how we can get around these though...
And indeed the game spends 90% in nvogl.dll when in the planet
Weighted average is one of the faster algorithms, so yes, it's not perfect, especially with many layers of transparent pixels. But if you don't start making whole ships or objects transparent, I think it does the job quite well