Hi all,tl;dr: we're switching base/ cc/ and skia/ to build with -O2 on Android.
On Wed, 17 Sep 2014 14:53:05 +0200, Fabrice de Gans-Riberi <fde...@chromium.org> wrote:Hi all,tl;dr: we're switching base/ cc/ and skia/ to build with -O2 on Android.Quite often the amount of code that benefits from maximum unrolling and inlining is just a tiny fraction of a program. It would be nice if there was a way to mark specific code blocks (or at the file level) as "this should be optimized with no other concerns than raw performance".I think the discussion has been up before, and honestly I am not sure it would work in reality. Way too likely that every developer would mark his favourite code with that flag to make a (globally) irrelevant performance test faster.
But nice job identifying areas to get good bang for the buck! If you do it again, you could try checking blink/wtf since that is kind of equivalent to base where you had some success.
A few months ago we went through a few test scenarios in Blink on Android with a CPU profiler and tried to identify places that were marked inline but weren't being inlined in practice because of "-Os"; ALWAYS_INLINE works. Unfortunately, that is the sort of performance tweaking that isn't stable long-term; it ought to be revisited every few months, and I don't think anybody has that on their plate.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
I assume it's not possible to use -O2 on a per-file basis? Why is that?
On Wed, Sep 17, 2014 at 6:22 PM, Chris Harrelson <chri...@google.com> wrote:I assume it's not possible to use -O2 on a per-file basis? Why is that?I experimented with that back in January. There are several reasons why we didn't go through with it:-Gyp does not support it. You can either have one-file-targets or use a "pseudo-gcc" script to replace command-line arguments for specific files before calling the real gcc. Neither option are very pretty.
-You cannot really automatize the file set to optimize. I tried going with the "most used functions during a run" but these do not necessarily benefit from being optimized for speed.
-If you go with a manual approach, it is unmaintainable. You don't know how the codebase is going to evolve and if your local speed optimization is going to remain relevant.
On Wed, Sep 17, 2014 at 10:15 AM, Chris Harrelson <chri...@chromium.org> wrote:On Wed, Sep 17, 2014 at 9:53 AM, Fabrice de Gans-Riberi <fde...@chromium.org> wrote:On Wed, Sep 17, 2014 at 6:22 PM, Chris Harrelson <chri...@google.com> wrote:I assume it's not possible to use -O2 on a per-file basis? Why is that?I experimented with that back in January. There are several reasons why we didn't go through with it:-Gyp does not support it. You can either have one-file-targets or use a "pseudo-gcc" script to replace command-line arguments for specific files before calling the real gcc. Neither option are very pretty.I see. But that can be fixed with effort, if it is justified.-You cannot really automatize the file set to optimize. I tried going with the "most used functions during a run" but these do not necessarily benefit from being optimized for speed.-If you go with a manual approach, it is unmaintainable. You don't know how the codebase is going to evolve and if your local speed optimization is going to remain relevant.I'm pretty sure the Blink engineers can identify some pieces of code are hotspots. Though point taken that it's a bit of a guessing game, and requires attention over time. I'll ask around to see what others think.FWIW, I'm pretty strongly exposed