Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert #78 #69 #122

Merged
merged 3 commits into from
Jun 23, 2021
Merged

Revert #78 #69 #122

merged 3 commits into from
Jun 23, 2021

Conversation

bbrto21
Copy link

@bbrto21 bbrto21 commented Jun 22, 2021

This PR includes :

Now, re-enable fontconfig as default

@swift-kim
Copy link
Member

Could you compare app launching performance when font_config is enabled vs. disabled? You can use my tool for measurement if you want.

@bbrto21 bbrto21 marked this pull request as draft June 22, 2021 05:08
@bbrto21
Copy link
Author

bbrto21 commented Jun 22, 2021

Could you compare app launching performance when font_config is enabled vs. disabled? You can use my tool for measurement if you want.

I'll try it!

@bwikbs
Copy link
Member

bwikbs commented Jun 22, 2021

You can use my tool for measurement if you want.

I was really surprised. You have a personal PPA! 😱

@bbrto21
Copy link
Author

bbrto21 commented Jun 22, 2021

@swift-kim I measured it using your tool.

As is -> Enable Fontconfig(On TM1)

Application STIME (ms) PSS (KB)
com.example.flutter_example_gallery 2160 -> 2669 (+23.6%) 66509 -> 67236 (+1.1%)

As is -> Enable Fontconfig(On R840)

Application STIME (ms) PSS (KB)
com.example.flutter_example_gallery 756 -> 888 (+17.5%) 94463 -> 95399 (+1.0%)

@bbrto21 bbrto21 marked this pull request as ready for review June 22, 2021 07:28
Copy link
Member

@bwikbs bwikbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that using font config is almost the only solution to display fonts correctly.
Thanks for your working!

@HakkyuKim
Copy link

Oh.. I will add "SamsungOneUI". But why? Could you give me the detailed reason?

@bbrto21
Adding "SamsungOneUI" will be on a separate PR, right?

@bbrto21
Copy link
Author

bbrto21 commented Jun 23, 2021

Oh.. I will add "SamsungOneUI". But why? Could you give me the detailed reason?

@bbrto21
Adding "SamsungOneUI" will be on a separate PR, right?

I missed that, thank you!

@swift-kim
Copy link
Member

@bbrto21 The result on R840 seems to be a bit misleading because the Evas GL renderer is used on the device and AUL cannot detect the time when the first frame of the app is drawn correctly.

I measured the launching time again using the --trace-startup option in profile mode and the result is as follows. Of course there are some errors although I've tried to minimize them.

On TW3 (tizen-6.0-unified_20201216.3_wearable-wayland-armv7l-tw3),

(Gallery/native)
  "timeToFrameworkInitMicros": 685318 -> 755597             (+70 ms),
  "timeToFirstFrameRasterizedMicros": 1856285 -> 2271489    (+415 ms),
  "timeToFirstFrameMicros": 1328676 -> 1798041              (+469 ms),
  "timeAfterFrameworkInitMicros": 643358 -> 1042444         (+399 ms)

(template/dotnet)
  "timeToFrameworkInitMicros": 439135 -> 468878             (+30 ms),
  "timeToFirstFrameRasterizedMicros": 934794 -> 1278863     (+344 ms),
  "timeToFirstFrameMicros": 757955 -> 1235623               (+478 ms),
  "timeAfterFrameworkInitMicros": 318820 -> 766745          (+448 ms)

On rpi4-arm64 (tizen-6.0-unified_20210331.1_iot-headed-3parts-aarch64-rpi),

(Gallery/native)
  "timeToFrameworkInitMicros": 316548 -> 316397             (-0 ms),
  "timeToFirstFrameRasterizedMicros": 1232617 -> 1384432    (+152 ms),
  "timeToFirstFrameMicros": 588777 -> 721575                (+133 ms),
  "timeAfterFrameworkInitMicros": 272229 -> 405178          (+133 ms)

(template/dotnet)
  "timeToFrameworkInitMicros": 99613 -> 109041              (+1 ms),
  "timeToFirstFrameRasterizedMicros": 492748 -> 598000      (+105 ms),
  "timeToFirstFrameMicros": 183035 -> 347693                (+165 ms),
  "timeAfterFrameworkInitMicros": 83422 -> 238652           (+155 ms)

The performance regression is quite obvious when fontconfig is enabled. Are we sure we want to apply this change anyway?

@bbrto21
Copy link
Author

bbrto21 commented Jun 23, 2021

The performance regression is quite obvious when fontconfig is enabled. Are we sure we want to apply this change anyway?

IMHO, Obviously the first start time increases, I think it's still an acceptable starting time.
and I believe that enabling fontconfig as default is the right way

@bwikbs
Copy link
Member

bwikbs commented Jun 23, 2021

The performance regression is quite obvious when fontconfig is enabled. Are we sure we want to apply this change anyway?

IMO, This is something worth taking.
Because font setting on the device is set by font config.

@bwikbs bwikbs merged commit 399c885 into flutter-tizen:flutter-2.2.1-tizen Jun 23, 2021
@xuelian-bai
Copy link

What's the advantage of enabling font config?
I'm profiling tvplus, before applying this patch, Engine::SetupDefaultFontManager took 29ms, after applying this patch, this function took about 170.866ms.

@xuelian-bai
Copy link

is it for missing text issue? anyway, if Engine::SetupDefaultFontManager took much time, it will postphone DartIsolate::CreateRootIsolate()(They are in the same thread), then postphone everything.

@xuelian-bai
Copy link

sorry, please ignore the above comments, I tested again twice, time consumption is different, I will check more.

@bwikbs
Copy link
Member

bwikbs commented Jun 29, 2021

is it for missing text issue?

yes

if Engine::SetupDefaultFontManager took much time, it will postphone DartIsolate::CreateRootIsolate()(They are in the same thread), then postphone everything.

We knew there would be a performance problem, and we introduced it because there was no other way to fix that issue.

First of All, we will look for areas that can be optimized, and if it is still a problem, we are considering the option of not using only that app.

@bwikbs
Copy link
Member

bwikbs commented Jun 29, 2021

I tested again twice, time consumption is different.

Maybe it's because of the font config cache.

@bbrto21
Copy link
Author

bbrto21 commented Jun 29, 2021

@xuelian-bai
From my understanding, unless we enable the fontconfig, we can't fully address the missing text problem. What we've done before this PR has only been a partial solution.
Yes, you are right, and we mentioned above, there is definitely a decrease in performance when initialize engine after this PR merged. But I believe that this performance is in a general state of engine basically, If we really need a performance improvement for initialization, I think the current state is the starting line to improve performance

@HakkyuKim
Copy link

FYI, the details of the text rendering issue: #96.

I hope it's a one-time 141ms delay on start-up. At the time, we decided to be correct than be performant but if the performance drop is noticeable, please share your findings so we can make improvements.

Additionally, there was another issue that got solved by using font-config: flutter-tizen/flutter-tizen#104.

@swift-kim
Copy link
Member

@xuelian-bai As a workaround, if your app doesn't use a custom font and you really want to optimize the startup performance, you can use a custom build of the engine without fontconfig enabled by reverting this commit.

@xuelian-bai
Copy link

Ok, thanks for explain, now I know it's necessary for this patch.
Here is the detailed testing result(tested on NikeM, profile mode), it's werid for the second launch, anyway, I will try to optimize launch performance based on this patch.

launch Before After(Enable font config)
first launch(cold boot) 322.271 ms 293.018 ms
second launch 38.831 ms 161.433 ms
third launch 24.956ms 30.158 ms

swift-kim pushed a commit that referenced this pull request Sep 27, 2021
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Nov 14, 2021
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Dec 9, 2021
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Dec 17, 2021
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Feb 7, 2022
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Feb 11, 2022
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request May 12, 2022
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Aug 5, 2022
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
* Revert "Create fallback font manager to solve performance drops (#78)"

This reverts commit c761164.

* Revert "Fix font breaking issues (#69)"

This reverts commit 5552dd5.

* Add SamsungOneUI to DefaultFontFamilies

Signed-off-by: Boram Bae <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants