One of the problems with the current MenuRenderer is, that it takes far too 
long to build the menus for large page trees. 
This has already been addressed by Stefan Foulis 
<https://twitter.com/stefanfoulis> 3 years ago in this issue: 
https://github.com/divio/django-cms/issues/5802

Now, for my current project, we have ~93k pages and the current 
implementation of the MenuRenderer is unusable, because
after publishing one arbitrary page, it rebuilds the whole tree – this 
requires about 8 seconds. Even if the tree is cached, it takes
~1 second only to fetch all the menu nodes out of the cache.

Since in my case, only a small part of the menu has to be rebuild, it makes 
much more sense to rebuild the menu tree
partially, and to only cache that partial representation. Then, instead of 
fetching 93k nodes from the cache, only a few hundreds
have to be transferred. However, since such implementations may vary from 
project to project, it makes most sense to make the
MenuRenderer configurable through a settings variable (say 
CMS_MENU_RENDERER), so that smaller django-CMS installations
can rely on the default implementation.

I already started to implement such a change: 
https://github.com/jrief/django-cms/tree/fixes/5802-optimize-menu-rendering
and it looks very promising. The time to render CMS pages dropped from a 
minimum of >1 second to a maximum of about 200ms. This
means that my implementation is 5x faster without caching, than the default 
implementation with caching.

If the core maintainers of Django-CMS are interested in this change, please 
tell me, so that I can prepare my changes as a pull-request.
In any case, it would be hugely beneficial to the django-CMS ecosystem, 
because the current implementation is a show-stopper for
sites with more than a few thousand pages.

– Jacob

-- 
Message URL: 
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to 
django-cms-developers+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-cms-developers+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-cms-developers/7956ba16-3560-46b1-af36-b105cf2d6370%40googlegroups.com.

Reply via email to