commit | cb15300d9b4358d9bdb6cfd33d433368700b3abe | [log] [tgz] |
---|---|---|
author | Richard Si <sichard26@gmail.com> | Thu Mar 14 06:25:38 2024 -0400 |
committer | GitHub <noreply@github.com> | Thu Mar 14 10:25:38 2024 +0000 |
tree | 26cc82e5a2785973a4f7d0b3df53f9f62c8716b3 | |
parent | c5d2d8bfeede5d36254335a52c13519ce8cf5fad [diff] |
Lazy import asyncio.sleep as it's expensive (#450) On my system, importing tenacity (_without tornado_) takes 35ms, and asyncio is singlehandedly responsible for 15ms. Some users do not ever use AsyncRetrying (or asyncio in their project generally) and it would be a shame for them to incur a unnecessary import penalty. Full disclaimer: I pursued this change primarily to reduce pip's startup time where asyncio was a nontrivial portion of the import timeline.