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

Edit data interface slow with large amount of terms #36

Open
andreesg opened this issue Jan 5, 2017 · 5 comments
Open

Edit data interface slow with large amount of terms #36

andreesg opened this issue Jan 5, 2017 · 5 comments

Comments

@andreesg
Copy link

andreesg commented Jan 5, 2017

With a large amount of terms (5000 tested) the edit data interface (@@taxonomy-edit-data) takes a long time to load. (up to 30 seconds)

Details:

  • The response from the server is fast (200ms)
  • The time to completely load the DOM takes up to 30 seconds.

The rendering seems to be the bottleneck.
Any ideas on what is causing the problem or how to improve the rendering?

@vincentfretin
Copy link
Member

We didn't test with such long taxonomies. Can you send me your taxonomy so we can test it and see what optimizations we can do? If you don't want it to be public, you can send it to vincent dot fretin at gmail dot com.

@vincentfretin
Copy link
Member

@andreesg ?

@andreesg
Copy link
Author

Thanks @vincentfretin !
I will send you an email still today with the 5k+ terms taxonomy.

Really curious to hear if it is possible to optimise the interface speed. Please let me know if you need my help.

@tomgross
Copy link
Member

We have taxonomies with large amounts of items to and found the bottleneck the construction of the vocabulary. The translation is not cached. There are two positions where this is relevant:

@tomgross
Copy link
Member

from Products.Five import BrowserView
from plone.app.querystring.interfaces import IQuerystringRegistryReader
from plone.memoize import ram
from plone.registry.interfaces import IRegistry
from time import time
from zope.component import getUtility
import json


ONE_DAY = 60 * 60 * 24


class PatchedQueryStringIndexOptions(BrowserView):

    @ram.cache(lambda *args: time() // ONE_DAY)
    def get_config(self):
        registry = getUtility(IRegistry)
        config = IQuerystringRegistryReader(registry)()
        return json.dumps(config)

    def __call__(self):
        self.request.response.setHeader(
            'Content-Type', 'application/json; charset=utf-8'
        )
        return self.get_config()

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

No branches or pull requests

3 participants