-
Notifications
You must be signed in to change notification settings - Fork 15
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
adapter lookup can be slowish #8
Comments
Maybe zopefoundation/zope.interface#48 fixes at least a bit of this problem. |
zopefoundation/zope.interface#48 didn't touch adapters at all, or any kind of lookups. It just dealt with utility registration and unregistration. |
Unfortunately, I haven't seen if there was any profiling for this particular case. But I wonder if it was having to load the AdapterRegistry from ZODB? For large adapter registries, that can be quite slow because every persistent object has to have a ghost created (or otherwise be found in the Connection cache); I have seen profiling for that. That's what leads to #51 (and our own BTree-based version of the adapter registry). |
Ugh, this was ages ago.... if I'd just remember... I don't have the codebase handy anymore. I think the global registry was not persistent. I think the problem was that z3c.form uses adaptation for "everything" to be flexible. Rendering a single widget/form uses a lot of adapters, and does a lot of adapter lookups. |
Argh! Sorry, I completely missed the fact that it was the global registry. There was a substantial performance increase in adapter lookups in zope.interface 5 thanks to various optimizations. This applies to all sorts of registries. Some particular Plone operations were seeing 50% improvements, other tests were 10% to 25%. |
I'd be happy with that, also don't have the code around anymore, nor the time to chase this. |
Thanks for the feedback! I think we can close this given the recent changes in zope.interface, plus the fact that the vast majority of this lives in zope.interface nowadays anyway (if I'm wrong, feel free to reopen). I encourage those with performance issues to open issues over there. |
In https://bugs.launchpad.net/zope.component/+bug/567746, @agroszer reported:
The text was updated successfully, but these errors were encountered: