Preferences

This would be a huge deal for Python startup time *if* it was applied to all the standard library packages recursively. Right now importing asyncio brings in half the standard library through transitive imports.

It's bad, but it's not that bad.

  $ time python -c '' # baseline

  real 0m0.020s
  user 0m0.015s
  sys 0m0.005s

  $ time python -c 'import sys; old = len(sys.modules); import asyncio; print(len(sys.modules) - old)'
  104

  real 0m0.076s
  user 0m0.067s
  sys 0m0.009s
For comparison, with the (seemingly optimized) Numpy included with my system:

  $ time python -c 'import sys; old = len(sys.modules); import numpy; print(len(sys.modules) - old)'
  185

  real 0m0.124s
  user 0m0.098s
  sys 0m0.026s

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal