Reputation: 8006
My question is mainly in relation to iOS, but also a general question for application programming. Does the size of a file affect the performance of the application overall? Does the file size affect the performance of the code within that file?
I would imagine that only the code that is executed effects performance on anything other than an insignificant level.
Referenced here at How file size affect performance?
It is stated that in a properly configured server the code gets locked into the memory, and then the effect is nonexistent. Is this true for other apps like iOS or Desktop apps?
EDIT: Additionally, is it worth exporting certain features to their own classes to improve performance, or would I only want to do this for readability?
Upvotes: 2
Views: 2733
Reputation: 8320
No. code length does not affect the app performance, but smaller code length helps other to understand your code better. This can be the case when you want someone else to add or modify some functionality to your application. When you can write same logic in less no of lines then it is preferable.
Upvotes: 1
Reputation: 11026
it's not the file size that decides performance of the app. your assets should have to be optimized for performance of your app.
Also I always prefer to keep the number of lines less for readability and understanding of the code. If you write everything in one file it will create chaos for you and for the other developers also.
If you are writing too much code than necessary than there might be the case you will use more variable and which result in more memory allocation and which directly effects the performance of your app.
Upvotes: 1
Reputation: 1191
The file size by itself doesn't directly affect the performance of your app. Your assets such as graphics, audio, etc could however affect the performance if they're not optimized. Of course, if you write some very long and in efficient code that results in a big file could affect the performance, however that's due to inefficiency than the number of lines.
Upvotes: 2