Closed jaroel closed 3 years ago
@jaroel thanks for creating this Pull Request and help improve Plone!
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.
Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:
@jenkins-plone-org please run jobs
With this simple comment all the jobs will be started automatically.
Happy hacking!
@jenkins-plone-org please run jobs
@jensens what do you think?
Well, +1 for caching, but maybe a bit more careful. I doubt this works with i.e. lineage.registry. I would take the current context, like its path, into a cache key.
OTOH, more globally, I stumbled over frequent of these getRegistry calls already an different places. I tend to create a central place to lookup registry once per request and then cache it on the request.
that said, this does not solve the second's line slowness.
I wish we'd didn't do utilities like this and just pass around the request with a registry on it. Anyhow, this change break stuff, so no-go.
This changes the
LanguageUtility.settings
property to azope.cachedescriptors.Lazy
. .settings is called multiple times and shows up in py-spy for restapi calls. Making this cached on the utility increases req/s on my machine with ~100.I do not know if and what negative side effect might be. Please handle with care.