-
Notifications
You must be signed in to change notification settings - Fork 2
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
Immutable collections are extremely slow #3
Comments
Comment by rgabbard A native implementation may be in order. I wonder if we could just steal the frozenset implementation from https://github.com/python/cpython/blob/491bbedc209fea314a04cb3015da68fb0aa63238/Objects/setobject.c and remove all mutating methods |
Comment by ConstantineLignos We certainly could go the C route. I'm less worried about the implementation time than the time required to sort out distribution for all platforms (which will possibly have to kept up for every new minor Python version). It may be more maintainable to do it in Cython. I have to run something for a while later tonight. If I still have energy left at that point, I might try do see how far I can get in doing a version of ImmutableSet in Cython and seeing how much faster it is. |
Comment by ConstantineLignos Digging in a little bit more, there probably won't be a difference between C and Cython for distribution; we're going to have to get into the business of building wheels either way. There are some solutions out there that can automatically build wheels for all Python platforms. Cython is less of a commitment (and is much more readable than a pure C extension) so I'd still like to give it a try first. |
Comment by rgabbard Trying Cython first sounds fine to me |
Issue by rgabbard
Friday Jun 01, 2018 at 19:13 GMT
Originally opened as https://github.com/isi-nlp/isi-flexnlp/issues/349
Timings for immutable set creation:
vs” numbers are “time for creation of the list used for initialization” vs “time for creation of the set”.
top numbers are
frozenset
bottom numbers areimmutableset
We are 50-200 times slower :-(
(this is for just object creation)
The text was updated successfully, but these errors were encountered: