Is their a performance penalty on IOS from importing (unnecessary) headers?
I have a fair number of categories I use on standard objective-c classes (NSString, NSArray, NSDate, etc. etc.). I traditionally have only imported the headers for these categories in classes that actually use them. It'd be much easier for me to simply include them all in the prefix header and never have to worry again about importing them individually. But I wondering if there is any sort of performance h开发者_运维问答it from doing so? I'm not really concerned if it takes longer to compile, only if it impacts performance of the actual app.
It might compile/link a bit longer but the application will run the same. Although it is not advisable from readability/maintainability point of view.
There shouldn't be a performance hit here, headers are only declarative and won't create anything that occupies memory.
精彩评论