1π
β
No, code speed is not affected by the size of your modules.
Additional imports only affect the memory footprint (a little more memory is needed to hold the extra code objects) and startup speed (more files are loaded from disk when your Django server starts).
However, this doesnβt really affect code running speeds; Python does not have to do extra work to run your code.
π€Martijn Pieters
Source:stackexchange.com