This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Yasser Alshalaan, nascheme, pablogsal, rhettinger, vstinner
Date 2019-02-17.08:50:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550393424.59.0.935371401294.issue36012@roundup.psfhosted.org>
In-reply-to
Content
> 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
History
Date User Action Args
2019-02-17 08:50:24rhettingersetrecipients: + rhettinger, nascheme, vstinner, pablogsal, Yasser Alshalaan
2019-02-17 08:50:24rhettingersetmessageid: <1550393424.59.0.935371401294.issue36012@roundup.psfhosted.org>
2019-02-17 08:50:24rhettingerlinkissue36012 messages
2019-02-17 08:50:24rhettingercreate