Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1e5452a0 authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi
Browse files

[res] Optimize Theme::ApplyStyle()

This is the heaviest operation during the configuration change
handling, as we recreate the asset manager object and rebase
all existing themes on that object as soon as any assets
change. The optimization here replaces the repeated binary
search + insert in a middle of an array with a merge of two
sorted arrays in place, achieving over 7x speedup:

Before:
  #BM_ThemeApplyStyleFramework 9722.817566754931 ns
After:
  #BM_ThemeApplyStyleFramework 1305.8760730843824 ns

It also adds a detailed explanation of the algorithm and its
assumptions to make it easier to optimize/debug it later.

Flag: NONE A performance regression fix, flag check is too slow
Bug: 345562237
Test: build, boot, atest + performance tests

Change-Id: I979e17cf4837cc8853a8d54cb4cea2a9631c3136
parent 72464747
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment