Are bikes with sloping top tubes lighter than bikes with horizontal top tubes? For many years bicycles nearly universally had horizontal top tubes, but that has changed: now most bicycles have &quot;compact&quot; geometry, with top tubes that slope downwards from front to back. The question &quot;What is the difference between a horizontal top tube and a sloped one?&quot; generated a great discussion of the pros and cons of &quot;compact&quot; frames versus frames with horizontal top tubes.  I have shamelessly stolen the pictures from that question.
Here's a bike with a horizontal top tube:

And here's a bike with a &quot;compact&quot; frame with a sloping top tube:

Answers to the other question pointed out that manufacturers don't need as many sizes with compact frames compared to frames with horizontal top tubes.  I know that fewer models of a frame is an enormous advantage for manufacturers, distributors, and retailers, because fewer SKUs require less frames to be stocked, which brings costs down and better satisfies customers.  That alone is surely strong motivation for manufacturers to adopt the compact geometry.
But I'm very curious to know if bikes with compact frames are actually lighter.  Answers to the other question disagree on this point, which is why I'm asking a new question.  Definitive proof would be nice, although that is surely hard to find.  If compact frames were actually heavier or less stiff, other things being equal, then I assume that manufacturers would be motivated to tell white lies that bikes with compact frames are lighter and stiffer; manufacturers would surely prefer that people think design changes were intended to benefit riders, rather than being purely for business reasons.
So are bikes with sloping top tubes lighter than bikes with horizontal top tubes?

Conclusion
My goal in asking this question has been to determine why manufacturers really changed to compact geometry from the older geometry with horizontal top tubes.  At least one manufacturer claims that the smaller frame triangles make the frame lighter and stiffer, and makes it easier to fit riders of all sizes.  I think the answer to this question is correct, and that compact frame bikes are not actually substantially lighter than bikes with horizontal top tubes.  I doubt that they're stiffer either, because the frame may be slightly stiffer, but the much longer and therefore bendier seatpost will probably negate that advantage.
Comments to the answer also point out that if the rider wants higher handlebars with a modern threadless stem, then the top tube has to slope for stand-over clearance.  That seems to me to be a mere style issue that could be solved without sloping the top tube, by making the front tube or the steerer a bit longer.  I believe the first picture in the question proves that point: the bicycle has high handlebars, a modern threadless stem, and a horizontal top tube.
That leaves what I believe is the real reason that manufacturers have switched to compact geometry: they don't need to stock nearly as many sizes.  This is an enormous business advantage, because manufacturers, distributors, and retailers don't need to stock as many SKUs.  Hopefully some of the cost savings result in lower prices for consumers.
To sum up, I don't think a bike with compact geometry is a substantially better bike than one with a horizontal top tube, other things being equal, but the bike with compact geometry was slightly cheaper to warehouse and distribute.
So are bikes with sloping top tubes lighter than bikes with horizontal top tubes?

No.
The frame may be lighter but the total bicycle ain't. The larger bending moment at the location where the seatpost enters the frame must be supported, and it means the seatpost requires more material besides needing to be longer. Even if the seatpost is not made more sturdy (which would mean you're not comparing apples to apples anymore, as you can't just increase the seatpost length and have an equally durable seatpost), a given length of the seatpost would weigh more than the same length of the seat tube.
The reason for sloping top tubes is something entirely different. Just look at the relative saddle and handlebar heights of the two bikes. The horizontal top tube frame has low handlebars, whereas the sloping top tube frame has high handlebars.
Now, you can have high handlebars on a horizontal top tube frame you can stand over, but it would require lots of spacers around the fork steerer tube, or alternatively a high-rise stem. Many people consider the look of either of these solutions ugly.
I have a Surly Long Haul Trucker I built myself. It has a 17 degree stem flipped down, so the stem is horizontal in addition to the top tube. It indeed requires a very very large number of spacers around the fork steerer tube. This is despite the fact that the height of the top tube above the ground is such that I can barely stand over the frame.
If you want to have handlebars at the same height as the saddle, either you require a sloping top tube, a lot of spacers or a high-rise stem.
This of course doesn't affect those of us who prefer a low racing style handlebar height.
So, the reason for sloping top tubes is most likely the fact that we have nowadays threadless headsets (aheadsets) and the stems that clamp around the fork steerer tube. When horizontal top tube bikes were the norm, we had quill stems that don't require spacers.