Skip to content

Commit 4803ff6

Browse files
committed
Small clarification
1 parent 47bba89 commit 4803ff6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

peps/pep-0810.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,17 @@ lazy. The filter has **almost no measurable performance cost**. To measure
765765
this, we benchmarked importing all 278 top-level importable modules from the
766766
Python standard library (which transitively loads 392 total modules including
767767
all submodules and dependencies), then forced reification of every loaded
768-
module to ensure everything was fully materialized. We compared four different
769-
configurations:
768+
module to ensure everything was fully materialized.
769+
770+
Note that these measurements establish the baseline overhead of the filter
771+
mechanism itself. Of course, any user-defined filter function that performs
772+
additional work beyond a trivial check will add overhead proportional to the
773+
complexity of that work. However, we expect that in practice this overhead
774+
will be dwarfed by the performance benefits gained from avoiding unnecessary
775+
imports. The benchmarks below measure the minimal cost of the filter dispatch
776+
mechanism when the filter function does essentially nothing.
777+
778+
We compared four different configurations:
770779

771780
.. list-table::
772781
:header-rows: 1

0 commit comments

Comments
 (0)