jaraco / jaraco/inflect

import time is unacceptably slow

Open
#212 7 comments 6 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Python
Stars
1.1k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

When switching from version 7.0.0 to 7.2.0, the import time grew from around 42ms to around 1.3 Seconds (31X slower)

By profiling the code running on import it seems that the issue stems from the switch from `pydantic` to `typeguard`

#### reproduction
```
pip install inflect==7.2.0
time python -c "import inflect" # results in around 1.3 seconds

pip install inflect==7.0.0
time python -c "import inflect" # results in around 0.13 seconds
```

`python -X importtime -c "import inflect"` was also useful to get the exact timing found above

related PR - https://github.com/jaraco/inflect/pull/199

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the import timings with the provided pip and python -X importtime commands, comparing inflect 7.0.0 and 7.2.0. Inspect the switch from pydantic to typeguard and the related PR for context; done means reducing import time toward the earlier baseline and confirming the improvement with the same commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.