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

ShadowEffect: Delay cache drop for switching shadow sizes performance improvements #2061

Merged
merged 4 commits into from
Nov 23, 2024

Conversation

leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Sep 19, 2024

Idk if this is a good and/or common way to do this but it should work 🤷

The reasoning here is that during the workspace switch animation the actor width and/or height often changes by one pixel back and forth. This would cause the shadow to be dropped and created again multiple times during a switch. By keeping them in the cache for 5 seconds before dropping them we can avoid this. While a second or so would be enough for a single switch the whole feel is a lot smoother when trying to switch over multiple workspaces in one go.

@leolost2605 leolost2605 requested a review from a team September 19, 2024 21:57
@leolost2605 leolost2605 requested a review from lenemter October 13, 2024 16:59
@leolost2605 leolost2605 changed the title ShadwoEffect: Delay cache drop for switching shadow sizes performance improvements ShadowEffect: Delay cache drop for switching shadow sizes performance improvements Oct 13, 2024
@leolost2605 leolost2605 mentioned this pull request Nov 21, 2024
Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

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

This PR doesn't fix a bigger performance problem with our ShadowEffect (e.g. when resizing a PiP) but it fixes the workspace switch performance. I think it makes sense to merge this.

@lenemter lenemter merged commit 74abd1e into main Nov 23, 2024
5 checks passed
@lenemter lenemter deleted the leolost/shadow-effect-delay-cache-drop branch November 23, 2024 16:04
@leolost2605
Copy link
Member Author

leolost2605 commented Nov 23, 2024

Yeah I agree it's less than ideal since it doesn't fix the root cause but it makes this specific animation a lot smoother so thanks :)

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.

2 participants