Use -O2 as default flag for stage1.
AbandonedPublic

Authored by AndreasK on Aug 22 2018, 9:19 AM.

Details

Reviewers
bgamari
tdammers
Summary

Build times when using the quick flavour:

stage1 opt | time (wall) | time (user)

-O1 |        13m  |        53m 
-O2 |        13m  |        51m

So even when we compile stage2 with -O0 (quick)
using -O2 on stage1 is already faster.

The difference is even bigger when freezing
stage1 and doing multiple builds or compiling
stage2 with optimizations.

Test Plan

time make

AndreasK created this revision.Aug 22 2018, 9:19 AM
tdammers accepted this revision.Aug 28 2018, 3:52 AM
tdammers added a subscriber: tdammers.

Ideally I'd like to see this tested on more machines and platforms, but if those timings are anywhere near accurate, I'd expect those to match too.

This revision is now accepted and ready to land.Aug 28 2018, 3:52 AM
AndreasK added a comment.EditedAug 28 2018, 4:10 AM

Ideally I'd like to see this tested on more machines and platforms, but if those timings are anywhere near accurate, I'd expect those to match too.

I've tested it my Windows Desktop and two Linux remote machines at different times which all gave similar results.
It's certainly possible that there are configurations where it's worse.

But I'm confident if it's slower at all for a config that it's an edge cases unless we change the impact O2 has on compile times.

tdammers requested changes to this revision.Aug 28 2018, 5:39 AM

That build failure is strange. Apparently enabling -O2 on stage1 triggers a bug that doesn't surface on Linux. gcc vs. clang, possibly?

This revision now requires changes to proceed.Aug 28 2018, 5:39 AM
bgamari accepted this revision.Aug 28 2018, 10:36 AM

Don't worry too much about the build failure; that bug will vanish when the patch is rebased.

I guess I will try to rebase this once CI is in order again.

AndreasK abandoned this revision.Jan 24 2019, 1:22 PM

Gitlab