Message335763
> can you include your python 2.7 runs? for me it looks similar
It will give similar results unless you switch to old-style classes (edit out the inheritance from object).
class A:
pass
A.x = 1
---------------------------------------
$ python2.7 var_access_benchmark.py
Variable and attribute read access:
6.7 ns read_local
10.9 ns read_global
18.9 ns read_builtin
24.4 ns read_classvar_from_class
30.2 ns read_classvar_from_instance
22.7 ns read_instancevar
25.5 ns read_instancevar_slots
99.3 ns read_namedtuple
40.9 ns read_boundmethod
Variable and attribute write access:
8.2 ns write_local
18.7 ns write_global
32.9 ns write_classvar <== Not formerly an outlier
32.5 ns write_instancevar
31.2 ns write_instancevar_slots |
|
Date |
User |
Action |
Args |
2019-02-17 08:50:24 | rhettinger | set | recipients:
+ rhettinger, nascheme, vstinner, pablogsal, Yasser Alshalaan |
2019-02-17 08:50:24 | rhettinger | set | messageid: <1550393424.59.0.935371401294.issue36012@roundup.psfhosted.org> |
2019-02-17 08:50:24 | rhettinger | link | issue36012 messages |
2019-02-17 08:50:24 | rhettinger | create | |
|