Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Lazy Imports -- I Like This Idea Date: Mon, 30 Mar 2026 11:21:55 -0700 Organization: A noiseless patient Spider Lines: 6 Message-ID: <87h5pxb2kc.fsf@nightsong.com> References: <10q22pv$2f060$2@dont-email.me> <10qc9fp$1v9oe$1@dont-email.me> <87qzp2axb3.fsf@nightsong.com> <10qcmg5$238e1$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 30 Mar 2026 18:21:57 +0000 (UTC) Injection-Info: dont-email.me; posting-host="f4ed530c3dec7634b1ccad69174fb331"; logging-data="2842937"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5feLvVJgCqsN2evN+MPRb" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:UZkpA4YYHqEyYFyOcf5wwbiQYnw= sha1:+MJ56lgVt3viUM6sKzSOzPrG41g= Xref: csiph.com comp.lang.python:197754 Lawrence D’Oliveiro writes: > That same script imports bs4, as it happens. It still manages an > overall startup time of just a quarter second. Importing bs4 can take a few hundred msec on the cheap VPS that I use it on. So deferring it speeds the program startup by that much.