(original) (raw)
Impressive stats! I didn’t know this command, thanks!
On Fri, 3 Nov 2017 at 20:47, Barry Warsaw <barry@python.org> wrote:
On Nov 2, 2017, at 23:22, Nick Coghlan <ncoghlan@gmail.com> wrote:
\> Another point worth noting is that merely importing the typing module
\> is expensive:
\>
\> $ python -m perf timeit -s "from importlib import reload; import
\> typing" "reload(typing)"
\> .....................
\> Mean +- std dev: 10.6 ms +- 0.6 ms
\>
\> 10 ms is a \*big\* chunk out of a CLI application's startup time budget.
Far and away so, except for the re module.
% ./python.exe -X importtime -c "import typing"
import time: self \[us\] | cumulative | imported package
import time: 72 | 72 | \_codecs
import time: 625 | 696 | codecs
import time: 354 | 354 | encodings.aliases
import time: 713 | 1762 | encodings
import time: 198 | 198 | encodings.utf\_8
import time: 98 | 98 | \_signal
import time: 233 | 233 | encodings.latin\_1
import time: 353 | 353 | \_weakrefset
import time: 264 | 617 | abc
import time: 402 | 1018 | io
import time: 136 | 136 | \_stat
import time: 197 | 333 | stat
import time: 227 | 227 | genericpath
import time: 377 | 604 | posixpath
import time: 2812 | 2812 | \_collections\_abc
import time: 787 | 4534 | os
import time: 315 | 315 | \_sitebuiltins
import time: 336 | 336 | sitecustomize
import time: 114 | 114 | usercustomize
import time: 1064 | 6361 | site
import time: 160 | 160 | \_operator
import time: 1412 | 1571 | operator
import time: 371 | 371 | keyword
import time: 817 | 817 | \_heapq
import time: 762 | 1579 | heapq
import time: 272 | 272 | itertools
import time: 635 | 635 | reprlib
import time: 99 | 99 | \_collections
import time: 3580 | 8104 | collections
import time: 112 | 112 | \_functools
import time: 781 | 892 | functools
import time: 1774 | 2666 | contextlib
import time: 272 | 272 | types
import time: 861 | 1132 | enum
import time: 76 | 76 | \_sre
import time: 426 | 426 | sre\_constants
import time: 446 | 872 | sre\_parse
import time: 414 | 1361 | sre\_compile
import time: 79 | 79 | \_locale
import time: 190 | 190 | copyreg
import time: 17200 | 19961 | re
import time: 374 | 374 | collections.abc
import time: 15124 | 46226 | typing
\-Barry
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/luca.sbardella%40gmail.com
--