-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use deferred renderer on Android #5337
Conversation
The |
eabb44f
to
26681bb
Compare
It doesn't seem to make much difference, I believe the problem isn't related to styles (switching styles isn't much slower than Windows as well for example). I actually profiled it a few days ago and I think the problem is that it spends more than 1 min for syscalls when loading the app, probably related to dynamic loading and the native part in general. |
Is this with a release build without debugger etc? |
For profiling it's required to have debugging enabled, so it's slower, but I already tried disabling it and enabling AOT and although it's faster, it still takes more than 30s to load IIRC. |
I wonder how well Xamarin.Forms and Uno perform in that area. We definitely need some benchmarks for startup etc. |
View.Content = _content; | ||
SetContentView(View); | ||
TakeKeyEvents(true); | ||
base.OnCreate(savedInstanceState); | ||
} | ||
|
||
protected override void OnResume() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will require an Avalonia-based Activity which prevents AvaloniaView from being used for embedding scenarios
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the PR to replace this with manual Tick
subscription count. However, I noticed it isn't enough to stop the timer as the animation clock (Avalonia.Animation.RenderLoopClock
) never stops, so the render loop doesn't stop, i.e. _items.Count
never reaches 0 here:
Avalonia/src/Avalonia.Visuals/Rendering/RenderLoop.cs
Lines 87 to 90 in 6ff478b
if (_items.Count == 0) | |
{ | |
Timer.Tick -= TimerTick; | |
} |
Is this a bug? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a known issue. For now I'd suggest to manually cast IRenderTimer to a concrete type and manually notify it about the subscription count
What does the pull request do?
ActivityTracker
.Removed useless EGL classes for Android that I added in the last PR, as there's a common implementation that works perfectly but I hadn't seen it.What is the current behavior?
Only immediate renderer works on Android.
What is the updated/expected behavior with this PR?
It is now possible to use deferred renderer on Android, and it's set as default. Performance is much better now.
Unfortunately,OnPause
/OnResume
isn't working, it shows a black screen, and I don't know if it was like that before, I'll take a look at that soon.Checklist