If so, wouldn't time be better invested in improving that?
Since the bulk of the web runs apache, that'd be the best way to improve the speed of the web, no?
Does Google typically improve open source projects or do they just rewrite them from scratch?
That's overly simplistic (even the idea that that's the only reason they pay for search placement on Firefox, though that's the direct exchange, is overly simplistic.) For funding Firefox and sponsoring Chrome, their goals included:
(1) avoiding a desktop browser monopoly by MS that could be leveraged to favor the favor certain online properties or extract rents from them (e.g., to prevent Google's core business from being "taxed" by MS), and
(2) (for Chrome more than Firefox) Drive the shape of browsers (both directly by implementing these features in a browser that would gain substantial use, and indirectly by creating pressure on other browser vendors to do the same) toward capabilities to more fully replace desktop/native apps, and thereby commoditize native platforms so that Google's core competence in the web space would have more reach. Making the web faster was part of this, though altruism isn't necessary to explain it.
Google typically takes multi-pronged approaches to similar problem spaces when they have sufficient resources (which, given the size of the cash hoard they have lying around, they usually do) and their is some uncertainty as to which approach will pay off best (as there quite often is.) So its not really inconsistent with Google's general behavior to see them doing both -- improving the existing product and doing a parallel replacement -- for the same product at the same time.
http://www.theregister.co.uk/2010/01/29/google_web_server/
This the reason you see:
server:gws
in the response headers when you visit Google.com.The real question is whether or not they should open-source it... and I'd lean in the "yes" direction, but I'm biased.