Yurii Karabas <1998uri...@gmail.com> added the comment:

I have just implemented `co_annotations` field for `CodeObject`.
I wrote a simple benchmark to measure the time required to import black module 
(I took black because it contains a log of annotations).

Benchmark simply run `python -m timeit -n 5000000 "import black"`.

Results:
```
Python 3.6.8
5000000 loops, best of 3: 0.0983 usec per loop
Python 3.7.6
5000000 loops, best of 5: 102 nsec per loop
Python 3.8.3
5000000 loops, best of 5: 97.4 nsec per loop
Python 3.9.0
5000000 loops, best of 5: 99.5 nsec per loop
Python 3.10.0a2+ with co_annotations
5000000 loops, best of 5: 92.4 nsec per loop
Python 3.10.0a2+
5000000 loops, best of 5: 98.9 nsec per loop
```

----------

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

Reply via email to