Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

Here's what the output looks like (here am comparing a fresh Py3.8 with Clang 
versus the same build with GCC-8):

$ make distclean && ./configure && make
$ py Tools/scripts/var_access_benchmark.py
Speed of different kinds of variable accesses:
   4.2 μs       read_local
   4.7 μs       read_nonlocal
  13.7 μs       read_global
  18.5 μs       read_builtin
  18.2 μs       read_classvar
  26.8 μs       read_instancevar
  20.3 μs       read_instancevar_slots
  19.1 μs       read_namedtuple
  26.9 μs       read_boundmethod
   4.5 μs       write_local
   4.8 μs       write_nonlocal
  18.8 μs       write_global
  89.9 μs       write_classvar
  37.1 μs       write_instancevar
  25.7 μs       write_instancevar_slots
   0.3 μs       loop_overhead

$ make distclean && ./configure CC=gcc-8 && make
$ py Tools/scripts/var_access_benchmark.py
Speed of different kinds of variable accesses:
   4.0 μs       read_local
   4.2 μs       read_nonlocal
  11.4 μs       read_global
  16.3 μs       read_builtin
  16.4 μs       read_classvar
  24.8 μs       read_instancevar
  20.1 μs       read_instancevar_slots
  16.8 μs       read_namedtuple
  23.2 μs       read_boundmethod
   4.3 μs       write_local
   4.5 μs       write_nonlocal
  15.4 μs       write_global
  89.4 μs       write_classvar
  33.5 μs       write_instancevar
  24.5 μs       write_instancevar_slots
   0.3 μs       loop_overhead

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35884>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to