-
Notifications
You must be signed in to change notification settings - Fork 0
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
Investigate cython #52
Comments
Initial results are very promising. Without doing any Cython specific tuning (which can improve speed dramatically, depending on the situation), CPython 2.7 sees gains of around 10-30%:
Not significant (1): Construct non-Singleton with args In this case, the 'non-Singleton' benchmarks are our baseline, so they show a 0-3% variance between the test runs as our margin of error. Of particular note: the two Singleton tests construct objects that descend from BTW, that was with doing just this in setup.py (not the real solution we want, but it shows how easy; I also had to move one interface definition into interfaces.py, fix a bug in zcml.py and tweak the use of setup(
...
ext_modules=cythonize(
'src/nti/externalization/*.py',
# zope.interface.Interface subclasses cannot be cython
# compiled
exclude=['src/nti/externalization/interfaces.py'] ),
) |
We have some uses of zope.deprecation and zope.deferredimport for BWC. Those aren't compatible with extension modules (they use Python frame tricks). With some effort we could refactor the project so that we can still provide those BWC aliases, but I'd prefer just to drop them, they've been deprecated/moved for quite awhile. Thoughts @papachoco and @jzuech3 ? |
It's OK w/ me. I think there are some still references in the OUBound projects to deprecated code; but those can be fixed easily. |
The platform code should be upto date |
cc @hagenrd |
-zope.deferredimport.deprecatedFrom(
- "Moved to nti.externalization.interfaces",
- "nti.externalization.interfaces",
- "IExternalObject",
- "LocatedExternalDict",
- "LocatedExternalList",
- "ILocatedExternalMapping",
- "ILocatedExternalSequence")
-# Things that have moved
-
-zope.deferredimport.initialize()
-zope.deferredimport.deprecatedFrom(
- "Import from .persistence",
- "nti.externalization.persistence",
- "NoPickle")
-zope.deferredimport.deprecatedFrom(
- "Import from .representation",
- "nti.externalization.representation",
- "to_external_representation",
- "to_json_representation",
- "to_json_representation_externalized",
- "make_repr",
- "WithRepr")
-
-zope.deferredimport.initialize()
-zope.deferredimport.deprecatedFrom(
- "Import from .nti.ntiids.oids",
- "nti.ntiids.oids",
- "to_external_ntiid_oid")
-# Things that have moved
-zope.deferredimport.initialize()
-zope.deferredimport.deprecatedFrom(
- "Import from nti.ntiids.oids",
- "nti.ntiids.oids",
- "MASKED_EXTERNAL_CREATOR",
- "DEFAULT_EXTERNAL_CREATOR",
- "to_external_ntiid_oid") |
Will usage of those deprecated imports result in log messages like so?
|
Yes. |
Looking across all environments logs for year-to-date the only deprecation warning I see that looks relevant is for |
I’ve learned a lot about cythonizing pure-Python code during the release of gevent 1.3. It can produce dramatics speed ups on CPython while still being compatible with PyPy and debugging (depending on the bottlenecks, of course). That should be investigated here with respect to #36 to see how it works out and if there are low-hanging fruits.
The text was updated successfully, but these errors were encountered: