node-nw-snapshot icon indicating copy to clipboard operation
node-nw-snapshot copied to clipboard

snapshot limitations

Open chino23 opened this issue 11 years ago • 5 comments

Hi Mikkel,

after playing around a bit with my source, which is around 10k lines of code, it seems to compile only on 0.9.2, nothing else.

Then I start it, it works, but when I change the screen it just crashes silently. Now I've read in the forum of node-webkit that the snapshot can't handle too many function calls at the same time, like for loops, or lots of timeouts at the same time, because the snapshotted code runs slower than normal javascript.

As you've been using that for your app, did you run into any issues with that? And what about minification, does that have much effect for the snapshot performance? I'd think no... but then there is a size limit for the compile...

Thanks for your time :)

chino23 avatar Nov 27 '14 12:11 chino23

I have LOTS of intervals and timeouts, and a lot of code (nearly breaking the limit on x64). I have had no problems with it at all. The performance is around 70% (or so the wiki says) of non-snapshotted javascript. This will only impact performance and shouldn't outright crash. Have you tried looking at the generated debug.log that node-webkit generates on crashes? Also, try having a process.on('uncaughtException', function(e){}) and window.onerror = function(e){}; and see what happens in there.

Minification helps with the size limit, it won't have any noticeable effect on performance.

I believe somewhere around 0.10.x the nwsnapshot binary was broken for a couple of releases. Have you tried with the newest 0.11?

miklschmidt avatar Nov 27 '14 13:11 miklschmidt

Thanks for that Mikkel, that gives me hope :)

There is supposed to be a crash dump on node-webkit but looking in the standard folder where it should be on mac, nothing is there, ever. I think I'll have to change the crash dump location and see if that works.

Those two functions, just put them somewhere in the code?

Regarding the builds, I have tried 11.1 and 11.2, same problem.

chino23 avatar Nov 28 '14 03:11 chino23

Put them in you index.html, so you're sure they're loaded. I'll run som tests on 11.x in the mean time.

miklschmidt avatar Nov 28 '14 22:11 miklschmidt

0.11.2 seems to work just fine for me.

miklschmidt avatar Nov 28 '14 23:11 miklschmidt

I've changed the crash dump location using

var gui = require('nw.gui');
gui.App.setCrashDumpDir(dir);

as stated in the node-webkit wiki but doesn't do anything.

Using those other two you've mentioned above, well I can't do much there as it's just closing when it crashes, right?

I've got a partial test running in 11.2, so it seems to work, but that's only compiling my services, that's it. If I include all directives, controllers, filters etc, it breaks. I guess I'll have to add them one by one to find the culprit...

chino23 avatar Dec 01 '14 03:12 chino23