We argue that, in a simple setting, the relation between the intensity of competition and cost-reducing investment is U-shaped. We consider a two-stage game with cost-reducing investments followed by a linear differentiated Cournot duopoly. We first show that, except for firms that are much less efficient than the competitor, investment in the subgame-perfect equilibrium is minimal for intermediate levels of competition, which is inversely parameterized by the extent of product differentiation. An extensive set of laboratory experiments also provides support for the U-shape, both for symmetric firms and for leaders. Also consistent with predictions, the relation is negative for firms that are lagging behind.