QuantEcon / Bookshelf

Code for the site QuantEconLib
1 stars 0 forks source link

Performance issue with page rendering #37

Open mmcky opened 6 years ago

mmcky commented 6 years ago

@tlyon3 I know you're across this but I couldn't find an issue for tracking / comments etc.

The current implementation is slow to render some notebook files that are of moderate size. Possible sources for this performance issue:

@tlyon3 given the computing is happening in the browser (at the client) should we be measuring performance using a tool like selenium?

tlyon3 commented 6 years ago

This seems to stem from codemirror. Analyzing a Google Chrome Performance Profile, all of the warnings about performance are centered around codemirror. I'll dig deeper to see if I can find a solution

tlyon3 commented 6 years ago

I've opened an issue in the @nteract/notebook-preview repo addressing the performance issues (https://github.com/nteract/notebook-preview/issues/20). The suggestion was to switch to Prism.js for the static syntax highlighting. Hopefully I can work with @rgbkrk to resolve the performance issues.

He also opened an issue in the @nteract/nteract repo discussing improving the usage of CodeMirror in their desktop application (https://github.com/nteract/nteract/issues/1977)

tlyon3 commented 6 years ago

I've added a pre-rendering option that can be turned on and off whenever wanted in commit 8d6fc5338c98e26b1a685ec7c39abe20f591bcf2.

There is still one bug in that when the option is turned on, the notebook rendering will take up the entire page instead of only rendering inside its div. Looking into it

tlyon3 commented 6 years ago

Switching to a different AWS instance seems to also have helped this issue. Running on the new one, performance is much better

sglyon commented 6 years ago

Is the option something users can turn on and off in their settings page, or is it something you have to turn off when you launch the app?

tlyon3 commented 6 years ago

This is an option in the API config. So the option must be set when the server is started. Individual users don't have control over the pre-rendering

mmcky commented 6 years ago

This is low priority now that the site is faster as is. Is there a way to get performance comparisons between the two settings?

mmcky commented 6 years ago

Given this is now low-priortiy I still think it is something worth developing (a static rendered version). I am going to add this to v1 milestone.