Performance: Folder structure patterns
MEDIUM IMPACT
This affects the initial load time and runtime efficiency by influencing import times and module resolution speed.
app/
main.py
api/
__init__.py
routes/
__init__.py
user.py
item.py
core/
config.py
database.py
models/
user.py
item.py
services/
user_service.py
item_service.pyapp/ main.py models.py routes.py utils.py services.py controllers.py database.py config.py
| Pattern | Module Imports | Import Depth | Startup Delay | Verdict |
|---|---|---|---|---|
| Flat folder with many files | Loads all modules at once | High | Blocks startup for 150-200ms | [X] Bad |
| Modular folder with focused subfolders | Loads only needed modules | Low to medium | Blocks startup for 50-80ms | [OK] Good |