Skip to content

Move desktop builds to ThinLTO #196308

Open
Open

Description

@gaaclarke

In #177694 we disabled LTO for linux builds because of infra cost. Instead of removing LTO we should switch to ThinLTO which should give us 80% of full lto at a fraction of the cost.

Activity

  1. gaaclarke commented on Nov 10, 2026

    @gaaclarke
    MemberAuthor

    Skia is reporting real differences in text performance with LTO versus none, like 10% faster benchmarks.

  2. gaaclarke commented on Nov 10, 2026

    @gaaclarke
    MemberAuthor

    I implemented this locally and compared the build times and build sizes:

    --no-lto --thin-lto Δ
    Clean build (wall) 142.7 s 151.9 s +9.2 s (+6%)
    Link step alone 1.2 s 11.2 s ~10×
    Incremental rebuild 1.8 s 13.6 s ~7×
    libflutter_linux_gtk.so size 17.0 MB 18.2 MB +6.8%

    So it increased size, we'd have to see some benefit of benchmarks.

  3. gaaclarke commented on Nov 10, 2026

    @gaaclarke
    MemberAuthor

    I ran txt_benchmarks with and without lto and on average it's 13% faster.

    Benchmark no-LTO ThinLTO ThinLTO/no-LTO p
    SkParagraphFixture/ShortLayout 1120 ns 942.8 ns 0.842 6.3e-08
    SkParagraphFixture/LongLayout 25.43 µs 20.39 µs 0.802 6.3e-08
    SkParagraphFixture/JustifyLayout 48.82 µs 42.99 µs 0.881 6.3e-08
    SkParagraphFixture/ManyStylesLayout 187.4 µs 153.6 µs 0.820 6.3e-08
    SkParagraphFixture/TextBigO/64 2295 ns 1894 ns 0.825 6.3e-08
    SkParagraphFixture/TextBigO/256 6853 ns 5571 ns 0.813 6.3e-08
    SkParagraphFixture/TextBigO/1024 42.65 µs 37.26 µs 0.874 6.3e-08
    SkParagraphFixture/TextBigO/4096 228.1 µs 205.8 µs 0.902 6.3e-08
    SkParagraphFixture/TextBigO/16384 1074 µs 963.1 µs 0.896 6.3e-08
    SkParagraphFixture/StylesBigO/8 381.7 µs 330.6 µs 0.866 6.3e-08
    SkParagraphFixture/StylesBigO/16 378.6 µs 328.4 µs 0.867 6.3e-08
    SkParagraphFixture/StylesBigO/64 379.3 µs 329.6 µs 0.869 6.3e-08
    SkParagraphFixture/StylesBigO/256 380.1 µs 327.6 µs 0.862 6.3e-08
    SkParagraphFixture/StylesBigO/1024 382.9 µs 329.0 µs 0.859 6.3e-08
    SkParagraphFixture/StylesBigO/4096 381.1 µs 329.5 µs 0.865 6.3e-08
    SkParagraphFixture/PaintSimple 12.99 µs 12.74 µs 0.980 3.9e-05
    SkParagraphFixture/PaintLarge 314.6 µs 307.8 µs 0.978 3.2e-07
    SkParagraphFixture/PaintDecoration 830.1 µs 801.4 µs 0.965 6.3e-08
    SkParagraphFixture/SimpleBuilder 809.6 ns 657.0 ns 0.811 6.3e-08
  4. gaaclarke commented on Nov 11, 2026

    @gaaclarke
    MemberAuthor

    Rusino has good suggestions on tweaking thinlto: #196314 (comment)

  5. added a commit that references this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions