Message414839
There are three kinds of changes that we might want to watch (that I can think of right now):
1. Any change.
Rather coarse and potentially expensive. Used by Cinder.
2. A new key being added (or a change to the keys version as a proxy).
Useful for detect shadowing of builtins by module globals, would save the keys version check for the module dict in `LOAD_GLOBAL_BUILTINS` and a version check in some `LOAD_METHOD` specializations.
3. The value corresponding to a particular key.
With this we could effectively convert both `LOAD_GLOBAL` specializations into a constant, given an effective way to de-optimize.
One way to support the three cases above would be to replace the dict version with a pointer to a data structure describing what it watched.
If the pointer is `NULL`, then nothing is being watched.
The data structure would need 2 bits to cover cases 1 and 2, and 1 bit (or byte) for each key in the dict keys (or case 1 could be implemented by setting all the bits for case 3). |
|
Date |
User |
Action |
Args |
2022-03-10 10:52:50 | Mark.Shannon | set | recipients:
+ Mark.Shannon, gvanrossum, barry, gregory.p.smith, carljm, dino.viehland, brandtbucher, Dennis Sweeney, itamaro |
2022-03-10 10:52:50 | Mark.Shannon | set | messageid: <1646909570.58.0.520161091299.issue46896@roundup.psfhosted.org> |
2022-03-10 10:52:50 | Mark.Shannon | link | issue46896 messages |
2022-03-10 10:52:50 | Mark.Shannon | create | |
|