Gearing should be considered as part of buying the bike. My mountain bike has three front chain wheels, with quite high gearing for the road and well as low gearing for off road hill climbing on dirt surfaces. My racing bike has high top gearing for speed.
My racing bike big ring and top gear is 52 / 13 and good for up to 45mph and I can't remember what my mountain bike is, but is is good for about 35mph.
Frames built with exotic materials are basically a marketing fad to get you to part with more money, unless you are a professional or serious amateur racer, then the extra 1-2% performance is important. Much more important is the quality of the groupset (wheel hubs, gears, chain set, bottom bracket bearings, gear changer, brakes and pedals). The higher the groupset the better the quality, the better the precision engineering, the more maintenance free they will be and especially how long they will last. With wheels the deeper the aluminium extrusion the more robust they will be on our pot hole strewn roads and the much less often they will need truing up.
By far the biggest factor for speed is: Your strength and fitness after that the type of bike / gearing / saddle and handle bar height are correctly set up / tyre type and width.
My mountain bike has knobbly tyres so there is much more road friction than my racing bike that I used to use for time trialing which has 20mm width, racing tyres and the riding position is much more upright on the mountain bike, so there is more wind resistance.