Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

>Wow, this is amazing. I just found that this is now faster than slots. 

Not only that: is even faster than the highly-tuned namedtuple access 
descriptors that used to be the faster access to an attribute:

3.9 results
-----------
  17.6 ns       read_classvar_from_class
  16.3 ns       read_classvar_from_instance
  23.2 ns       read_instancevar
  19.7 ns       read_instancevar_slots
  17.9 ns       read_namedtuple
  39.2 ns       read_boundmethod

Now this is the faster way to get an attribute:

3.10 results
------------
  17.9 ns       read_classvar_from_class
  16.9 ns       read_classvar_from_instance
  14.1 ns       read_instancevar
  20.0 ns       read_instancevar_slots
  18.0 ns       read_namedtuple
  40.7 ns       read_boundmethod

> Should we mention that in What's New?

Good idea!. I will prepare a PR complementing the current paragraph.

----------

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

Reply via email to