-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Extremely slow after updating from v0.50.1 to v0.52.1 and later #7715
Comments
Added tag in above git repo : nw_issue_7715. Please check out that one, since develop may be changed |
This very same issue reamins in v0.58.0. It is still at least 10 times slower than v0.50.1 -- which makes it totally impossible to upgrade past v0.50.1. I am curious if I am the only one seeing this? Pragma-git is a pretty heavy application, but the startup is not where I would expect slowdowns. Anything I can do to aid? |
NWJS Version : 0.52.1 ... 0.60.0 (as downloaded from https://nwjs.io/downloads/ )
I am willing to participate in finding the cause, but need some guidance on how. Please connect with me |
The problem occurs exactly when switching from v0.50.3 (good) to v0.51.0 (bad) |
Thanks for the program for reproducing. Could you shrink it down to some simpler sample? It would be helpful to fix the issue. |
I wish I has an idea where to start! With the 0.51.0 version the dev summary graph shows 99.9% "scripting", and no "idle" I have two thoughts : Could spawning external processes be different (I run git commands via simple-git)? Could async function handling be different? From your experience with what happened between the two versions, would you have any high-level idea on what to focus my search on? |
I have now managed to make a micro-version that displays the problem. https://github.com/pragma-git/issue7715.git (Tag = version2) Instructions how to run are in the comments in the file |
Wow, getting closer. Now I have come down to exec a child process being the culprit. All timers, and function calls removed. I don't think it can become more clear than this. https://github.com/pragma-git/issue7715.git (Tag = version3) Same instructions as before : Instructions how to run are in the comments in the file frameless_window.js. You need the two versions 0.50.3 (or lower) and 0.51.0 (or higher) to reproduce. The difference is striking from about 15 ms to about 450 ms |
More information : To be able to do this profiling, I made a timer call the same code multiple times (Tag = version 4). Thus, it is the same child-process call as used in (Tag = version 3), mentioned in previous comment. |
Did I give you sufficient information to work on this issue? |
Some timing information for version (51.0 and 50.3), running with debug flag The javascript simply prints time-output before and after the child_process.exec, whereas a bash From below, the following can be deduced:
See https://github.com/pragma-git/issue7715/tree/timing_info , Tag=timing_info
|
Did it reproduce on Linux? Or it is Mac only.
…On Tue, Jan 18, 2022, 11:22 AM pragma-git ***@***.***> wrote:
Some timing information for version (51.0 and 50.3), running with debug
flag /Applications/nwjs_v0.51.0.app/Contents/MacOS/nwjs
--enable-logging=stderr --v=2 . and
/Applications/nwjs_v0.50.3.app/Contents/MacOS/nwjs --enable-logging=stderr
--v=2 .
The javascript simply prints time-output before and after the
child_process.exec, whereas a bash date command prints the time from
within the bash-shell (note that its using MacOS bash, so modify if running
on other platform)
From below, the following can be deduced:
- Javascript clock and bash clock were very close in this experiment
- Child process in v51.0 executed after a long initial delay
See https://github.com/pragma-git/issue7715/tree/timing_info ,
Tag=timing_info
version 50.3
------------
[80955:259:0118/190350.816905:INFO:CONSOLE(37)] " ", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (37)
[80955:259:0118/190350.817130:INFO:CONSOLE(40)] "1642529030816 (start time)", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (40)
--> NOTE + 18 ms
[80955:259:0118/190350.835987:INFO:CONSOLE(49)] "1642529030835 (done time)", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (49)
[80955:259:0118/190350.847301:INFO:CONSOLE(43)] "1642529030100 (bash time)
--> NOTE : "bash time close to start time" => clocks are matching between shell and javascript
", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (43)
[80955:259:0118/190350.847503:INFO:CONSOLE(46)] "1642529030847 (child exit time)", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (46)
TOT = 30 ms
version 51.0
------------
[80482:259:0118/190306.857709:INFO:CONSOLE(37)] " ", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (37)
[80482:259:0118/190306.857900:INFO:CONSOLE(40)] "1642528986857 (start time)", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (40)
--> NOTE +500 ms
[80482:259:0118/190307.354109:INFO:CONSOLE(49)] "1642528987353 (done time)", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (49)
[80482:259:0118/190307.364911:INFO:CONSOLE(43)] "1642528987100 (bash time)
--> NOTE : "bash time close to exit time"
", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (43)
[80482:259:0118/190307.364990:INFO:CONSOLE(46)] "1642528987364 (child exit time)", source: chrome-extension://kmdapnfabpgbijhamipfegdgochkobfm/frameless_window.js (46)
--> NOTE : "bash time close to child exit time"
TOT = 500 ms
—
Reply to this email directly, view it on GitHub
<#7715 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABIMGJOW3BPMKSVGGINEQLUWWVVZANCNFSM43ZQ3PNA>
.
You are receiving this because you were assigned.Message ID: <nwjs/nw.
***@***.***>
|
No, the test-code does not appear to be a problem under Linux. |
This could be a clue ? Is nwjs signed on MacOS from version 51.0 ? |
Sorry to bother again. I am curious if there is some more information, or anything I can do. For me this is an issue prohibiting me from moving past nwjs version 50.3 on MacOS. I really want to be on track with the newer nwjs releases, especially since other improvements and bug fixes are bound to come. It is not a good option to keep my software on different nwjs versions on Linux, Windows, and MacOS platforms. |
Problem remains on MacOS nwjs SDK v0.64.0 |
I am not proficient enough to compile nwjs, but I would be happy to help by testing different versions. I am willing to aid and test versions between 50.3 and 51.0 to isolate where the slow-down was introduced. Would that be helpful? Is it possible to let the build-bot create such versions for me to download and test? It would be greatly appreciated if you could comment on if this would be a way forward, or if you maybe already know the cause of this problem and instead could hint on a possible time-line. |
And since I cannot help looking for clues... This is the difference in
|
The most minimal way to show this, is now to start the nwjs app on MacOS with remote-debugging, and paste code. Requirements: Two versions 0.50.3 and 0.51.0 SDK versions for MacOS downloaded, and renamed from Behavior : 50.3 version shows a very short time printed, and 51.0 a very long time printed to console
|
Would there be some way to fix the sudden slowdown on child_process.spawn for nwjs from version 0.51.0?I have put years into a new git client (pragma-git) soon to be announced to the open source. It feels that it will one day break on MacOs if I cannot follow the nwjs releases. I mean, it is not unheard of that new MacOS releases break features, which could make nwjs 0.50.3 fail. Such feature would most likely be repaired in a later nwjs, but would render pragma-git incompatible because of the spawn slowdown-bug, which has remained in all versions post 0.50.3. Therefore I have read a lot, and I wish to view a few of the things that I hope could inspire you guys who understands the inner parts of nwjs :
I find it very annoying that I don't have the understanding and programming skills to fix this. Is this something I can hope somebody else knows how to do? |
@pragma-git @rogerwang @JanAxelsson We could stick with 0.50.x but the problem is it's not working on macOS Ventura. So for now we have 2 choices and none of them is good tbh:
|
Will look into it soon. Thanks. |
@rogerwang I can confirm that the fix included in the latest nightly build is working! Thanks! |
I can confirm that it fixes the problem for pragma-git as well. Thanks a lot, you made my day! 💖 |
NWJS Version : 0.52.1 and 0.53.0
Operating System : MacOS and probably others
Expected behavior
Same rendering speed as v0.50.1 and earlier.
Actual behavior
GUI rendering is at least a factor 10 slower than in v0.50.1.
How to reproduce
git clone https://github.com/pragma-git/pragma-git.git
cd pragma-git
git switch develop
/Applications/nwjs.app/Contents/MacOS/nwjs .
# On mac, use similar on other platformsYou may also click the "question-mark icon" at the top left corner, or the "settings icon" at the lower right corner, to observe more of the slow rendering
I have also tried the following
--disable-features=nw2
flag in above run commandremoved
"chromium-args": "--disable-gpu"
in package.jsonThe text was updated successfully, but these errors were encountered: