Series

The import graph

What an import costs, who gets charged for it, and what deferring it actually moves — measured on the interpreter that shipped the feature.

In reading order · 2 entries

  1. Part 1

    lazy import Moved 26.8 ms and Removed None of It

    A lazy import of asyncio costs no measurable time and no modules at startup. Read the name once and 26.4 of the 26.8 ms come back. Deferral is not removal.

  2. Part 2

    Swapping Two Imports Moved 5.5 ms to a Different Module

    Importing logging before asyncio moves 5.5 ms from asyncio's line to logging's. The program does the same work. The cumulative column charges whoever got there first.

Arrow keys to move, Enter to open.