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
libcpp.map.map 'get' is 1e6 slower than libcpp.map.map '__getitem__' #1521
Comments
Without trying it, I guess that Works as designed. |
ok, thanks. I guess I'm surprised that 'get' works at all, then;
shouldn't it be "not defined" on the Python side if it's not defined on
the C++ side, or alternatively do something smarter & faster?
I'd be happy to put in a PR if the behavior should (or could) be changed.
|
Actually, this is quite dangerous. Makes sense for primitives like complex, but imagine
I think we'd be better off with errors about missing methods here. |
robertwb
added a commit
to robertwb/cython
that referenced
this issue
Nov 16, 2016
In particular, this limits errors caused by mutating implicit temporary objects, e.g. cdef vector[int] v = ... v.pop() See also github issue cython#1521.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With this code:
I find that for 200,000 dictionary entries, the 'get' function is about 1m times slower than getitem -- please see https://gist.github.com/ctb/ecea9809b8e1b6503abda1316b0de5b1 for a full working example. I'm sure I'm doing something wrong but I'm not sure what...
The text was updated successfully, but these errors were encountered: