Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: