Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Importing numba is slow #4927

Closed
Closed

Description

@cgohlke

Hello,

on my Windows workstation with >1200 pip installed packages, import numba is very slow:

py -3.7-64 -X importtime -c "import numba"
import time: self [us] | cumulative | imported package
import time:   3069020 |    3235357 |           pkg_resources
import time:      2526 |    3237883 |         numba.entrypoints
import time:     31084 |    4448066 | numba

The culprit is

from pkg_resources import iter_entry_points

Importing pkg_resources is known to be excruciatingly slow. See pypa/setuptools#510

How about replacing the use of pkg_resources for entrypoints by importlib_metadata or entrypoints if possible?

Reporting a bug

Activity

  1. stuartarchibald commented on Dec 5, 2019

    @stuartarchibald
    Contributor

    Thanks for the report. IIRC this approach mirrors that taken in pandas for the plotting backends https://github.com/pandas-dev/pandas/blob/0c2b1db198ce628ca889ad25c1179fff4ab3337c/pandas/plotting/_core.py#L1613-L1615 but it would appear they delay this scanning until needed. It seems like the suggested fixes involve taking on dependencies. CC @seibert, thoughts?

  2. seibert commented on Dec 5, 2019

    @seibert
    Contributor

    Adding a dependency on import_metadata I think would be fine. It is pure Python, and already packaged in Anaconda as well. It also appears in the standard library as of Python 3.8:

    https://docs.python.org/3/library/importlib.metadata.html

    so this seems like heading toward where Python is already going.

  3. stuartarchibald commented on Dec 5, 2019

    @stuartarchibald
    Contributor

    Task here is to remove the use of pkg_resources and replace with importlib_metadata and fix up the builds for that dependency chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions