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

Improve opening animation performance #231

Merged
merged 4 commits into from
Jul 30, 2022
Merged

Conversation

passsy
Copy link
Member

@passsy passsy commented Jul 30, 2022

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 often
  • delay corner animation
  • theme merging wasn't cached

Together, I saw a significant reduction of jank.


Results

Test setup:
iPhone SE, iOS 15.1
Flutter version 3.3.0-0.1.pre on channel beta
I always completely restarted the app, cleared the timeline and only measured close and open (two taps).

Before improvements (debug build)
Screen-Shot-2022-07-31-00-15-25 67

After improvements (debug build)
Screen-Shot-2022-07-31-00-16-02 15

Save or not to save Layer

I did not notice a significant performance improvement when switching from Clip.antiAliasWithSaveLayer to Clip.hardEdge

Clip.antiAliasWithSaveLayer profile build
Screen-Shot-2022-07-31-00-31-30 96
Clip.hardEdge profile build
Screen-Shot-2022-07-31-00-33-07 63

Instead, Clip.antiAlias and Clip.hardEdge produce very noticeable artifacts (see below 👇), thus not changing this.

Clip.hardEdge vs. Clip.antiAlias vs. Clip.antiAliasWithSaveLayer
Screen-Shot-2022-07-31-00-50-57 30

According to the profile, this was the most expensive method in the wiredash package
Replace with AnimatedBuilder
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.

1 participant