Answer the question
In order to leave comments, you need to log in
Is it important to have few imports in the code?
And is it true that if there are fewer imports, is it faster to run the code?
Answer the question
In order to leave comments, you need to log in
You need to have exactly as many imports as your code needs. Obviously, if you don't import the library you're using, then the code won't run. Obviously it makes no sense to import something that is not used.
Yes, it's true that imports affect startup speed. Each imported script must be read from disk, parsed, interpreted, objects of data loaded from it must be created in memory, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question