You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using PyDict_Next would likely be a faster way to iterate over dictionaries. Implementing this in the IR seems a little tricky, since the API call mutates multiple registers, whereas primitive ops are expected to only mutate a single register. Returning a tuple internally might be a reasonable way to support this.
We now use the "return a tuple internally" strategy for dealing with exc_info tuples in the exception APIs and it works well, so that is probably the way forward for this.
Fixesmypyc/mypyc#167
The implementation is pretty straightforward and follows the idea proposed in the issue. The perf impact is actually pretty small, around 1%
Note: we don't apply the fast path to subclasses here to make dict subclassing safe.
Using
PyDict_Next
would likely be a faster way to iterate over dictionaries. Implementing this in the IR seems a little tricky, since the API call mutates multiple registers, whereas primitive ops are expected to only mutate a single register. Returning a tuple internally might be a reasonable way to support this.For more information, see https://docs.python.org/3/c-api/dict.html#c.PyDict_Next.
The text was updated successfully, but these errors were encountered: