Is it more optimal to specialize or generalize your planets?
Specialization is more effective but also requires more player effort and management. I tend to specialize but lately I've been putting 1 farm and 1 stock market on anything PQ7 or better even if that planet is going to be a monster research or manufacturing planet (and yeah sometimes depending on the victory I'm going for I've turned PQ15+ planets into research monsters). Part of the reason for the farm is that since I tend to grab econ and morale racials keeping 11 - 16 billion people happy doesn't take any moral boosters and it generates enough money even with just 1 stock market to support several factories/labs so the planet isn't drawing the treasury down and sometimes 1 or 2 more factories won't actually speed the production of ships anyway.
The farm everywhere giving the stronger pop base makes everything harder to invade as well and allows more transports to be built/bought without much worry. A PQ10 with initial colony, starport, farm, stock market, 4xfactory, and 1xpower plant is actually self sustaining until industrial sectors I believe (if the pop is maxed) and can still crank out medium and large hulls in reasonable time. Killing the farm and the stock market for 2 more factories will cut build times only 3-4 weeks maybe on those ships, though the better the factory tech the more impact those 2 tiles have, if I'm sticking with older factory tech it doesn't help as much.
I've tended to put at least a basic factory or 2 on my econ planets so that auto-upgrades of the econ buildings happen faster, but those factories tend to get upgraded to morale structures later on or if morale is good more stock markets.
But I'll end up with about an 80/20 mix of specialized and generalized planets. The more generalized planets are generally because of tile bonuses as I generally can't get myself to not use the bonus even when I know I'd be better off ignoring it.

I've not been successful with all factories or all labs yet but I'm also generally only about 25% win rate on crippling right now as well so I'm still toying with everything.