-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 startup performance #5242
Comments
You may also take a look at CoreRT to build native binaries and get fast startup time: |
I measured 1 second startup using a i5-8400 CPU and fast SSD drive, for most types of apps, that's fine, but some types of apps need to start faster, like a text editor or video player. I want to port my mpv.net video player project to Linux and macOS, currently it uses WinForms in the main dialog and WPF in all other dialogs, it starts fast. There are users that start a video player dozens of times per day, so it has to start fast. |
This problem was tracked in another issue - #5666 @stax76 great to hear that you are interested in porting mpv.net! |
Also, Avalonia 11.0 previews now support NativeAOT, which also greatly improves startup time. |
Thanks for the quick help, I will try/investigate it. |
Is your feature request related to a problem? Please describe.
Avalonia takes quite long to show a window. A simple hello world app takes 2.4 seconds on my machine. If I use
PublishReadyToRun=true
the startup time decreases to 1.4 seconds. However, that's still very long compared to Windows Forms which takes less 0.5 seconds. Launching an Avalonia application therefore feels unresponsive and slow.Hand stopped | Avalonia 0.10.0-rc1 | .NET 5.0.1 | Intel Core i5 2400 | Samsung SSD 850 Evo
Describe the solution you'd like
The latter would make Avalonia applications feel more responsive even if they take a few seconds to start. A splash screen could come as a separate window or like UWP as a start screen in the window itself.
Describe alternatives you've considered
Because I expect the vast majority of my applications users to use it on Windows, I implemented a splash screen with Windows Forms. I launch the splash screen on another thread and can close it again in Avalonia's
Window.Opened
event. In order to move the focus from the splash screen to the Avalonia window I have to useSetForegroundWindow
fromUser32.dll
becauseWindow.Activate()
andWindow.Focus()
don't work when another thread has the focus.The text was updated successfully, but these errors were encountered: