NW2, Another Key Step of NW.js

328 views
Skip to first unread message

Roger Wang

unread,
Nov 13, 2019, 6:32:20 AM11/13/19
to nw.js

The new browser window implementation for NW.js, which is called "NW NewWin" internally, a.k.a "NW2", is an important refactoring I've been working on. The NW.js application's GUI window implementation and various internal webpage handling around it has been migrated from Chrome App's codebase to the Chrome browser's codebase.

This work will be the foundation of more major features (tab support, find in page etc), fixing important issues and better software quality. It's one of the most exciting changes since the 0.13 release. It's also found with issue fixed and better performance in user's testing.

In theory, your application should just work in the same way without any issues as it's a pure internal change. It got the first release in 0.35.4 earlier in this year under --enable-features=nw2 switch. The switch will become the default soon in the upcoming 0.42.4 release. Thanks to all the community members who helped testing and contributing to it in the tracking issue, including @Blatman, @TheRealDannyyy, @elpeleq42, @Yonezpt, @jtg-gg and many others.

After the release, if you find anything unusual in your application, try the --disable-features=nw2 switch first and file an issue on GitHub if your application works well with NW2 disabled. I'll keep the old NW1 mode maintained for several major versions and then start gradually removing code for it. Eventually the NW1 mode will not be supported and NW2 will be mandatory.

Cheers,
Roger Wang, NW.js creator and maintainer

Ivica Ico Bukvic

unread,
Oct 12, 2022, 3:41:40 PM10/12/22
to nw.js
Resuscitating an old thread in hope of a clarification. I have a visual programming environment Pd-L2Ork that uses nw.js for its front-end. Starting with 0.42.4, the GUI has gotten *significantly* slower. I am talking about 10-fold or even more slower. A complex SVG-based canvas populated with objects would load in 0.42.3 in a second, whereas on 0.42.4 and newer it takes upwards of 10 seconds!

I am suspecting this is due to nw2 features being enabled. If so, what is the highest version of nw.js that still supports --disable-features=nw2 switch?

If this is not due to nw2 flag enabled, what else could be the culprit? Is there some additional security layer running that I could disable since my app runs locally and connects via localhost proxy to the backend?

Thanks.

Best,

Ico

sysrage

unread,
Oct 12, 2022, 4:20:35 PM10/12/22
to nw.js
I recommend opening an Issue on GitHub that includes a minimum reproduction of the problem (a single canvas that is measurably slower with 0.42.4 as compared to 0.42.3).

Ivica Ico Bukvic

unread,
Oct 12, 2022, 5:24:13 PM10/12/22
to nw.js
Unfortunately, in this case there is no simple way to make reproducible problem when it requires the full logic of my software. Best thing is to download my software (Pd-L2Ork) ideally on Windows or Linux where swapping nw.js versions is a matter of replacing a single folder inside installed application's folder. The app already ships with nw.js 0.42.3.

You can download it from:

http://l2ork.music.vt.edu/main/make-your-own-l2ork/software/ (click on the "Complete (a.k.a. ‘Burrito Supreme’) Installer" section to expand it and download a version for the appropriate platform)

Replacing nw: On Linux nw version is located in /usr/lib/pd-l2ork/bin/nw folder. On Windows in C:\Program Files (x86)\Pd-L2Ork\bin\nw. Mac is difficult since the files are all mixed, so I discourage testing on that one, even though results are the same. Just replace it with SDK (*not* runtime) of any other version by renaming that version's folder to nw and replacing this one. Then restart the app.

To open something graphically intense: start Pd-L2Ork (pd-l2ork on command line or double-click on the shortcut). Help->Help Browser->scroll to the bottom and click on L2Ork Tweeter and then again on L2Ork Tweeter.

Observe the time it takes to open and populate the window.

I will submit a ticket shortly. Thanks.

Ivica Ico Bukvic

unread,
Oct 12, 2022, 7:31:06 PM10/12/22
to nw.js
I just submitted the ticket. That said, there are also a few questions in my original post that I don't think are appropriate for a ticket.

Best,

Ico

--
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/1YMHN3m1rtI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwjs-general...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwjs-general/2d9a7ca3-3e51-45c3-bd3b-a6ca051d3693n%40googlegroups.com.

Roger Wang

unread,
Oct 12, 2022, 7:35:41 PM10/12/22
to Ivica Ico Bukvic, nw.js
That switch still works with the latest version. I don't think the performance issue is related to NW2.

If it's hard to produce a minimal case, would it be possible to make a version of your app that works in the Chromium browser -- it would be easier to compare NW with the browser under the same workload.

Regards,
Roger

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwjs-general/2e16b22b-5064-4d4d-b145-fda887f167c7n%40googlegroups.com.

Ivica Ico Bukvic

unread,
Oct 12, 2022, 7:43:41 PM10/12/22
to Roger Wang, nw.js
The app uses chromium browser for all its windows. I will try to save static snapshot of the page with tons of SVG elements and see if I can load it directly into an nw.js instance.

Best,

Ico

Ivica Ico Bukvic

unread,
Oct 12, 2022, 10:57:21 PM10/12/22
to nw.js
OK, so I was able to "extract" the way screen looks when it is loaded. Linked are index.html and package.json that is essentially the snapshot of how the screen looks when it loads.

https://l2ork.music.vt.edu/data/pd-l2ork/test.tar.gz

You can start the same using 0.42.3 and compare it to newer versions.

This should constitute the minimally reproducible example. I attached the same to the ticket on the github.

Best,

Ico

Ivica Ico Bukvic

unread,
Oct 12, 2022, 11:01:03 PM10/12/22
to nw.js
The difference is less obvious since there is no background communication (there is a lot of network code going back and forth to draw all this, but it is all identical in both cases). Still you can see the difference. I also spotted a lot of ssl errors on 0.42.3 being printed out in the console. Could it be that the 0.42.4 and onward use ssl layer for network proxy? If so, could this be the bottleneck?
Reply all
Reply to author
Forward
0 new messages