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

Faster startup #1217

Open
jerrygreen opened this issue Mar 3, 2024 · 8 comments
Open

Faster startup #1217

jerrygreen opened this issue Mar 3, 2024 · 8 comments

Comments

@jerrygreen
Copy link

jerrygreen commented Mar 3, 2024

Is your feature request related to a problem? Please describe.
I don't have exact metrics, but it seems it takes around 1-1.5 seconds to go from launch to render a basic hello-world app with just a static html file. Nothing complex yet – and it still around 1.5 seconds just to load a single static html...

There's also the white background problem, but the background is not really the issue as I described a workaround here:

Describe the solution you'd like
I don't know the code to fix the startup situation, but I kinda hope that it is possible to run static files faster. It's unreal to spend 1.5 sec just to load statics. For just .html statics, I would expect no more than 0.2 sec to start the app.

Describe alternatives you've considered
Electron???? 😒
Maybe even non-js... Rust? 😮
Of course, Rust isn't really an option... I would spend ages to get used to Rust language. It runs fast, though...

Additional context
I'm sorry for not having exact metrics at hand, but VSCode (written in Electron) seems to show some initial UI in just 0.2-0.4 sec, and it loads entire code editor with bunch of files in total of 1.5 sec... That's an entire complex app in 1.5 sec! While in neutralino-app, we spend 1.5 sec just for one single static .html hello-world kind of an app 😒 So I'm pretty sure, as fatty as Electron is, it can start up from a static html file – much faster than Neutralino. For a tiny app of 2 megabytes, I would so much expect it to startup instantaneously... But currently, Neutralino isn't capable to do this: no matter how tiny it seems, it requires hell lot of a time to startup.

@hschneider
Copy link

Here it shows the GUI with a delay of approx. 0.5 sec. under macOS and Win 11 (virtual machine).
Can you give closer details about your OS and underlying hardware (CPU, RAM) ?

@jerrygreen
Copy link
Author

My specs:

Processor Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
RAM 16.0 GB, DDR4, 2666 Mhz (2 of 4 slots used, each 8 GB)
Windows 10 (22H2)

At the time of my check, the resource consumption was:

CPU 5%
RAM 10/16 GB

Therefore, there's enough resources to use.

I recorded the process, and did verify in a video editor, to see exact time: from loading icon to appear, to the first UI being shown. Here's some more info:

  1. Cold start: 2.3 seconds
    gif5

  2. Warm start: 1.3 seconds
    gif6

You may note I'm not showing the default blank white screen on start, it's simply due to this approach:

put in config: "hidden": true, then in your application run Neutralino.window.show() asap (inside index.html)

If by saying «GUI» you mean this white blank non-interactive screen, then we're talking about different things.
What I mean by GUI: when actual HTML being visible, like some text etc.

@hschneider
Copy link

Strange. Do you have some anti-virus tool running in background?

@jerrygreen
Copy link
Author

For you to understand – all other programs are running perfectly fine. Just as always.
I'm not experiencing any system staggers or anything. Nothing «lags».
The program itself works just fine. It's just Neutralino starts it not as fast as I would like to.

@hschneider
Copy link

Maybe indeed a Win10 issue with WebView initialization:

https://learn.microsoft.com/en-us/answers/questions/1185053/msedgewebview2-show-slowly-first-time-in-cold-star

@shalithasuranga : Would make sense to flag this issue for further investigation on GSOC. It might be faster with newer WebView DLLs that still run under Win10. Maybe it only happens when an outdated DLL release is present.

@hschneider
Copy link

You can try to install a newer version here:
https://developer.microsoft.com/de-de/microsoft-edge/webview2/?form=MA13LH#download
The latest one is 122.x. At best choose it from the right hand "Fixed Version" install.
It's recommended to reboot after install.

@dhruvgupta0503
Copy link

Can I work on this issue

@dhruvgupta0503
Copy link

Lazy Loading: Instead of loading all resources and dependencies upfront, consider lazy loading non-essential components or modules. This can help prioritize the loading of critical resources and defer the loading of less important ones until they are needed.
we can use this technique

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants