Is there any performance difference in my application if I change the number of files of source code (without changing anything in the code itself)? I mean, if, for example, I put all my classes in just 1 file (without new relationships, as static classes), instead 50, will this have a performance benefit (or drawback)?
Just wondering…
The question is not about mantainability. I just want to know if this increases performance or not (and why).
It may have a (negligible) impact on the performance of the compiler while it builds your project. After that it is irrelevant, since what is actually run is the class files produced by the compiler.
A more interesting question is whether there is a performance difference at runtime between having the class files in a directory hierarchy and having them in a JAR file (which again could be compressed or uncompressed). Having them in an uncompressed JAR file is probably fastest, but this will only impact startup time, and probably not much.
Once an application has started, class definition are kept in memory, and where they were stored does not matter.
In terms of PHP (which is what I guess this question comes from), Java always and implicitly uses a bytecode cache.