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

Investigate the advantage of enabling SkSL warmup #99

Closed
swift-kim opened this issue May 30, 2021 · 6 comments
Closed

Investigate the advantage of enabling SkSL warmup #99

swift-kim opened this issue May 30, 2021 · 6 comments
Labels
performance Performance-related topics

Comments

@swift-kim
Copy link
Member

What is shader compilation jank?

https://flutter.dev/docs/perf/rendering/shader

How to enable SkSL warm-up on Tizen?

  1. Set the FlutterProjectArgs.persistent_cache_path value to either a system temp directory or the app cache directory before starting the engine. Alternatively, the cache directory can be set by implementing fml::paths::GetCachesDirectory() in fml/platform/linux/paths_linux.cc (not tested). Shaders will be stored to this directory on the first run of an app, and the cached shaders will be used on subsequent runs.

  2. You can optionally bundle the shaders with a tpk (as a json file in res/flutter_assets) to accelerate the first run of the app on other devices: https://flutter.dev/docs/perf/rendering/shader#how-to-use-sksl-warmup

Pros and cons

Read more

@swift-kim swift-kim added the enhancement New feature or request label May 30, 2021
@xuelian-bai
Copy link

as the result I shown, sksl warmup can reduce time in GrGLProgramBuilder::finalize(), then reduce DrawSnapshot time about 200ms, but this will result in more time before OnMakecurrent in the same thread, that's why you can't see any improvement, I will check why.

@swift-kim
Copy link
Member Author

@xuelian-bai Thank you for sharing. I was just to correct what you mentioned about the "launch time" because the sksl warmup typically doesn't reduce the startup time but rather increases it. From the medium link that I provided in the above comment, you will see

To avoid jank, Flutter has provided the ability to cache shaders during a training run, which are then packaged and bundled with an app, and compiled before the first frame while the Flutter Engine is starting up.

App startup latency is longer because the bundled shaders need to be precompiled.

@swift-kim
Copy link
Member Author

Currently the following message is logged out to the console when an app is run with the --verbose-system-logs option in debug mode.

E/ConsoleMessage( 4279): [WARNING:flutter/common/graphics/persistent_cache.cc(258)] Could not acquire the persistent cache directory. Caching of GPU resources on disk is disabled.
E/ConsoleMessage( 4279): [INFO:persistent_cache.cc(227)] No sksl asset found.
E/ConsoleMessage( 4279): [INFO:gpu_surface_gl.cc(79)] Found 0 SkSL shaders; precompiled 0

@xuelian-bai
Copy link

did you set the path FlutterProjectArgs.persistent_cache_path?

@swift-kim
Copy link
Member Author

@xuelian-bai No. I know why the error is displayed. The above comment just states the current status.

@swift-kim
Copy link
Member Author

This will not be necessary if flutter-tizen/embedder#15 is implemented. Let's focus on flutter-tizen/embedder#15.

@swift-kim swift-kim closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance-related topics
Projects
None yet
Development

No branches or pull requests

2 participants