-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Android shadow performance #26789
base: main
Are you sure you want to change the base?
Android shadow performance #26789
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
2a51aee
to
2a218db
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
2f0b86f
to
eccf37e
Compare
I'm late to the party but an attempt to improve shadow's performance was made before here #10523. Moving the code to the Java side might help but I think what would benefit the most is a shadow cache. All views that have the same size and the same shadow properties (very common scenario in CollectionView items for example) should use the same bitmap. This will eliminate a huge number of calls including C# to Java ones. There is an implementation of the shadow cache in the PR. |
@AmrAlSayed0 thanks for sharing, I'll check it out. |
d1ead23
to
a7e91b9
Compare
a7e91b9
to
ed3e55f
Compare
Description of Change
Apparently
DrawShadow
has an absurd impact on the performance.Here's a speedscope from our app sorted by self time descending, also look at total time %!!!
This PR:
Glide
'sLruBitmapPool
to reduce the memory pressure on JavaI tried as much as possible to not break signatures but given Java to C# bindings are automatically generated, there was no way completely avoid touching public APIs.
Here I've executed the testing host app with
return new ShadowBenchmark();
as main page and scrolling the CV for ~30 seconds.Before
DrawShadow
takes 24%.before.speedscope.json
After
DrawShadow
is gone.after.speedscope.json
Issues Fixed