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

Performance of language tree rendering #1350

Closed
robinboening opened this issue Jan 22, 2018 · 3 comments
Closed

Performance of language tree rendering #1350

robinboening opened this issue Jan 22, 2018 · 3 comments
Labels

Comments

@robinboening
Copy link
Contributor

If you have multiple thousands of pages in a language tree, loading of such takes about 20seconds on an average server.

# Log excerpt from a server
Completed 200 OK in 21325ms (Views: 21196.6ms | ActiveRecord: 85.4ms)

These numbers are taken from an example where I rendered a fully unfolded page tree of ~7000 pages. ActiveRecord is pretty fast while the view rendering is way too slow to call it acceptable.

@pascalj already improved a lot with this PR ac564d7 but its supposed to speed up the loading time when branches are folded.

For now we monkey patched the behaviour for us to have:

1.) Pages folded by default when a User is created.
2.) Enabled folding in sorting mode.

I think the implementation of the Page folding mechanism is discussable as a general matter. Enabling folding in sorting mode actually feels right and works pretty well.

@tvdeyen
Copy link
Member

tvdeyen commented Aug 20, 2018

Rendering a page tree of 8000 pages nested 10 levels deep takes ~11 seconds to load and serialize on my Late 2016 MBP (Core i5, 3.1GHz). Another 5-6 seconds is rendering time (parsing the JSON and painting it with Handlebars).

I tried to speed up the serialization with panko_serializer that uses OJ (a C driven JSON serializer for Ruby) and was not able to significantly speed it up. So the current serialization code is already optimized and fast. See me WIP on that in this branch.

What we can do to make it faster is to optimize the actual painting/parsing in the browser. Most likely by using a faster DOM parsing library like VueJS. This is a larger task, though.

I encountered a problem with Turbolinks caching requesting the page tree twice if navigating with Turbolinks. I fixed this in #1463

@yosiat
Copy link

yosiat commented Dec 7, 2018

Hi @tvdeyen!

Thanks for looking for at Panko, I am the author I ran the same benchmark as you did and found something interesting that might help you here.

On my computer (MacBook Pro (15-inch, 2017), 2.9 GHz Intel Core i7) I ran the seed with the same amount of pages you did.

The request takes 9 seconds which 90% of the time is in serializing, a profiling reveals that -

  • 40% is on serializing permissions attributes
  • 21% is on serializing `status_serailizers attributes

see https://gist.github.com/yosiat/190868de7ad2a8211fa3a4c7aade6098#file-flame-svg

If I can help somehow with Panko,
please let me know!

Sorry, didn't noticed it's old issue

@github-actions
Copy link

This issue has not seen any activity in a long time. If the issue descriped still exists in recent versions of Alchemy, please open a new issue or preferably open a PR with a fix. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants