jaraco/inflect

import time is unacceptably slow

開放

#212 建立於 2024年6月20日

 (7 則留言) (6 個反應) (0 位負責人)Python (125 個分叉)github user discovery
bughelp wanted

倉庫指標

星標
 (1,082 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南