Improve opening animation performance #231
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening Wiredash has been a bit laggy, most noticeably on iOS and macOS due to the shader jank.
While experimenting with different clipping behaviors
Clip.antiAliasWithSaveLayer
vs.Clip.antiAlias
vs.Clip.hardEdge
as recommended in #225 I found several points of improvement.setState
was called way too oftenTogether, I saw a significant reduction of jank.
Results
Before improvements (debug build)
After improvements (debug build)
Save or not to save Layer
I did not notice a significant performance improvement when switching from
Clip.antiAliasWithSaveLayer
toClip.hardEdge
Clip.antiAliasWithSaveLayer
profile buildClip.hardEdge
profile buildInstead,
Clip.antiAlias
andClip.hardEdge
produce very noticeable artifacts (see below 👇), thus not changing this.Clip.hardEdge
vs.Clip.antiAlias
vs.Clip.antiAliasWithSaveLayer