Skip to content

Import time is very slow (>5s) #878

@adumont

Description

@adumont

Importing google.api_core is very slow. In some of our benchmark, when loading as part of our app, it can take over 10s.

Environment details

  • OS type and version: Windows 11 Enterprise, build 26100.7171
  • Python version: Python 3.12.7
  • pip version: pip 25.2
  • google-api-core version: pip show google-api-core

Name: google-api-core
Version: 2.28.1
Summary: Google API client core library
Home-page:
Author:
Author-email: Google LLC googleapis-packages@google.com
License: Apache 2.0
Location: C:\Projects\xxx\venv\Lib\site-packages
Requires: google-auth, googleapis-common-protos, proto-plus, protobuf, requests
Required-by: google-api-python-client, google-cloud-core, google-cloud-modelarmor, google-cloud-vision, langchain-google-community

Steps to reproduce

  1. Run:
python -X importtime -c "from google.api_core import __version__"
  1. analyze output, for example using https://kmichel.github.io/python-importtime-graph/.

I attach the output in my case: importtime.txt. This is the visualization:

Image

Code example

python -X importtime -c "from google.api_core import __version__"

Metadata

Metadata

Assignees

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