|
|
|
|
|
by nomel
3855 days ago
|
|
The slow startup from imports is my biggest annoyance with python. We had a decent sized library at a previous company that pulled in modules that defined huge register maps, wrapped c++ libraries, etc. I wrapped all imports in a lazy importer that was triggered by the first attribute access. It brought our script startup times from 3 seconds down to a fraction. Blows me away that this isn't default behavior for ALL modules. |
|
You could I suppose do some cache warming to make sure the first user request isn't slowed down, but its one more thing to think about.