Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: flutter/engine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10e2df60b053
Choose a base ref
...
head repository: flutter/engine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b867c4da54cc
Choose a head ref
  • 3 commits
  • 11 files changed
  • 2 contributors

Commits on Aug 31, 2023

  1. Configuration menu
    Copy the full SHA
    7e85807 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    878ebcf View commit details
    Browse the repository at this point in the history
  3. [web] More efficient fallback font selection (#44526)

    The PR improves the code size and runtime performance of fallback font selection.
    
    ### Performance improvements
    
    Initialization of the data structures to support fallback font selection has been moved from creating the FallbackFontManager (first frame) to the first use, i.e. the first frame actually needing a fallback font.
    
    The numbers reported below are for a lightly edited version of the counter demo that appends to the counter about ~300 missing code points that need ~25 fallback fonts to cover the missing code points. Timings taken from a few profiles on my performance workstation.
    
    |  |  Before | After  | 
    | --- | ---: | ---: |
    | FallbackFontManager() |~100ms | <2ms |
    | First need | 0ms | 12ms |
    | Subsequent need | 20-30ms | <1ms |
    
    ### Size improvements
    
    |  |  Before | After  | � |
    | --- | ---: | ---: | ---: |
    | main.dart.js | 1586405 | 1477319 | -109086 (-6.87%) |
    | brotli -9 | 427304 | 401611 | -25693 (-6.01%) |
    
    ### Algorithm notes
    
    #### Startup
    
    The old algorithm built an interval tree from the code point ranges of the ~140 fallback fonts and uses the interval tree to build a list of fonts that support each missing code point. The new algorithm uses a binary search map that directly produces the list of fonts. There are fewer binary search ranges (~22k) than the aggregate ranges for all the fonts (~26k).
    Most of the startup time gain comes from using a data unpacks directly into a useful form rather than needing processing to build an interval tree (~12ms vs ~100ms).
    
    #### Running
    
    The runtime for font selection is greatly improved for several reasons
    
    - The code point space is partitioned into components so that code point counting can be batched.
    - When a font is selected, the counts are updated incrementally rather than being recomputed.
    - The counts are held in fields of the NotoFont and component objects rather than in Maps or Sets.
    
    Batching, incremental update and avoiding hash tables are roughly multiplicative in effect.
    
    ## Issues
    
    - flutter/flutter#131440
    
    *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
    
    [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
    rakudrama authored Aug 31, 2023
    Configuration menu
    Copy the full SHA
    b867c4d View commit details
    Browse the repository at this point in the history
Loading