-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
./python.exe -m timeit -s 'd = {"a": 1}' 'd["a"]'
# 10000000 loops, best of 5: 29.1 nsec per loop
S="
class A: pass
d = A()
d.a = 1
"
./python.exe -m timeit -s $S 'd.a'
# 20000000 loops, best of 5: 17.3 nsec per loopI think string-only-key dict is very common.
If there is optimisation technique done for attribute access, how difficult it would be to transfer similar benefit to dict object?
Metadata
Metadata
Assignees
Labels
No labels