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

Slow..... #6

Open
zam6ak opened this issue Sep 8, 2016 · 13 comments
Open

Slow..... #6

zam6ak opened this issue Sep 8, 2016 · 13 comments

Comments

@zam6ak
Copy link

zam6ak commented Sep 8, 2016

I have a report which uses plain HTML table and handlebars.
Report has 8000+ rows. No scripts of any kind - just pure HTML to PDF.

With phantomjs it takes about 15 seconds to render.
I tried using electron recipe with 'electron-ipc' and 'electron-server' strategy and
the same report takes 40+ seconds to render....

Any idea why would it be that much slower?

@bjrmatos
Copy link
Owner

bjrmatos commented Sep 9, 2016

@zam6ak hmmm i have experienced slow rendering on windows machines, can you upload a working demo on a repository for me? it will help me to figure out why it is slow.

@zam6ak
Copy link
Author

zam6ak commented Sep 9, 2016

Unfortunately I can't share the data....
You can try to generate fake data using https://www.mockaroo.com/
As for the template - it is just handlebars with HTML table....

@pofider
Copy link
Collaborator

pofider commented Sep 10, 2016

Yes electron seems to be really slower (maybe only in some cases), but I'm not sure if there is something we can do about it. The slowdown likely comes from deep down somewhere in chromium codebase.

@bjrmatos if you have any clue what to improve, you can compare the speed on this simple example
https://playground.jsreport.net/studio/workspace/ryQffOb3/4

@bjrmatos
Copy link
Owner

@pofider thnk you for the example, it will help me to figure out!

@bjrmatos
Copy link
Owner

interesting, using https://playground.jsreport.net/studio/workspace/ryQffOb3/4 my numbers on OSX are:

phantomjs (using phantom-serverstrategy)
114 pages
first render -> 29941 seconds
second render -> 28805 seconds

electron (using electron-serverstrategy)
107 pages
first render -> 11489 seconds
second render -> 11208 seconds

phantomjs (using dedicated-processstrategy)
114 pages
1rst -> 30198 seconds
2rst -> 29898 seconds

electron (using dedicated-processstrategy)
107 pages
1rst -> 11600 seconds
2rst -> 11344 seconds

i need to get a windows machine to investigate more, but yeah it is slow on windows 😆

@notatestuser
Copy link

I can't get this package to work at all on Windows. I always end up with a Error: Timeout when executing in electron regardless of the strategy I choose. Do you know why this might be?

@zam6ak
Copy link
Author

zam6ak commented Nov 28, 2016

did you do:
npm install electron-prebuilt --save

@notatestuser
Copy link

I did, yes.

@notatestuser
Copy link

This is when running under iisnode. When ran directly it works! I'll consider this a file access permission issue.

@pofider
Copy link
Collaborator

pofider commented Nov 29, 2016

You can try to change this in the config :

electron: { 
  strategy: 'dedicated-process',
}

However I would recommend avoid using iisnode and rather use iis as reverse proxy to a windows service running jsreport. If you are not limited by infrastructure rules of course..

@bjrmatos
Copy link
Owner

bjrmatos commented Dec 3, 2016

@notatestuser we ( @pofider and I ) have tested jsreport-electron-pdf on windows with iisnode and it causes too much troubles, seems like electron on iisnode doesn't work well :( you can try with @pofider 's recomendations.

@notatestuser
Copy link

Indeed. I've tried all the strategies without any luck. Interestingly though phantomjs is fine, even with a prebuilt binary downloaded into node_modules. I'd really like to be able to render in electron!

@notatestuser
Copy link

I've opened bjrmatos/electron-workers#263 for the iisnode issue.

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