bpo-36904: new function _PyStack_DictAsVector#13308
Conversation
|
|
Sorry, something went wrong.
|
I'm wondering whether we should use a special |
Sorry, something went wrong.
|
I didn't think of the freelist but it's true that I already had bad feelings about messing with the tuple size like that. What do you think of my proposal (see above) of making a special |
Sorry, something went wrong.
|
For a good answer I'd need to write the code :)
|
Sorry, something went wrong.
write the code or just see the code (written by me for example)?
This two-step process is going to take more work: it requires to discuss two API designs and implementations instead of one (with the first one going to be thrown away anyway once we do the second). So, I'd like to do it in one step if possible. |
Sorry, something went wrong.
On the other hand, adding the "refcount poking" part is pretty simple. So if you agree with doing just that manually (without changing |
Sorry, something went wrong.
For a relatively complex optimization? benchmark the code, before and after.
But without the first, it'd be hard to argue that the tuple subclass actually brings any benefit. Tuple subclasses behave quite differently from exact tuples (they don't use freelists, for one).
Definitely! All I ask for before the optimization is a correct baseline. It might then very well turn out that the optimization is unnecessary. |
Sorry, something went wrong.
|
I decided to drop this idea. It's more controversial than I initially thought and I see why (I can't disagree). For reference: #14517 optimized |
Sorry, something went wrong.
Provide
_PyStack_DictAsVectoras safe and more efficient replacement for_PyStack_UnpackDict.https://bugs.python.org/issue36904
https://bugs.python.org/issue36907