Skip to content

Cache entry points #3054

@ocelotl

Description

@ocelotl
 i'm not sure but i think that importlib does not cache entry points and reads them every time `entry_points` is called. 

when i checked it, it took about 5-10 ms for each call to entry_points. since it probably depends on the number of packages installed these times are not representative but indicate that there is some overhead.

afaik pkg_resources (although much slower than importlib) caches everything when the module is first imported, so only the first import of the module takes some time.

since OTel uses quite a number of entry points maybe it would make sense to lazily load and cache them?

Originally posted by @mariojonke in #3047 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions