back to article Python slithers faster by adding lazy imports that load code after startup

Python programs are set to get faster startup times with PEP 810 "Explicit lazy imports," which allows scripts to defer loading imported libraries until they're actually needed rather than at startup. The Python Enhancement Proposal (PEP) was put forward by Pablo Galindo Salgado, Steering Council Member, on October 3 and …

  1. Charlie Clark Silver badge

    Welcome. but really only necessary to please the serverless cloud

    Loading times for most Python applications are irrelevant: if you're actually doing anything like opening a database connection or, heaven forbid, moving data around, you'll hardly notice. But not for the "serverless" who pay for every microsecond.

    But, like async, over time it will probably become standard and you won't have to think about it.

  2. Paddy
    Thumb Up

    I see a use-case

    In LSF /Slurm /SGE job submission, you can write pre/and post Job scripts for setup, checks, reporting, and teardown that will be run as part of every job. Usually I write these as bash scripts with internal use of commands like grep and sed, and sometimes awk. I tend to be careful of using Python due to its startup time.

    Seems I'll have to do more timings and comparisons with sed/grep/awk startup times when lazy becomes more available.

  3. AdelaideSimone

    10 seconds of research is too much

    This is completely false. It's annoying to set up, but, Python has had lazy loading built-in to the std library for a very long time. It's part of importlib. It's literally called LazyLoader.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon