-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Accelerate attr dict lookups #45113
Comments
Problems:
The "Vision": Replace virtually all dict lookups for attributes with exported key direct accesses by combining the above approaches with __slots__ or per-instance specialization. |
File Added: words.py |
Hi, I'm not in a position to review the patch, but a small design suggestion: if you need to abuse a bit in the hash structure, wouldn't it be simpler to abuse the least significant bit of the (PyObject*) pointer to the value stored in the dictentry? It seems to me that on today's architectures, pointers are at least 2-byte aligned (if not 4-byte). |
Thanks for the suggestion. I decided not to manipulate the pointer though, because it seems more dangerous, portability-wise. Also, I have discovered a small problem with the patch (curse the build system for not rebuilding properly when things change :-) but I see no use posting it and continuing work on this patch, as it seems to generate so little interest. |
Is there any interest in this or can it be closed as implied in msg52790? |
This was an interesting idea. Essentially, it created cell-style objects for entries in a global dict so that functions using load_global could access and update the values directly. All dicts paid a price for this, but only module dicts would benefit. A more refined approach would be to create a custom dict type just for module globals. Mark, you're right. The patch appears to have been abandoned and not generated interest. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: