Search code examples
javaperformancedead-code

Does "dead" code hinder Java application performance?


I just installed the Unnecessary Code Detector for Eclipse and ran it on my project. I see a lot of so-called "dead code". Although, from an organizational standpoint, it makes sense to remove dead/unnecessary code, it got me thinking:

Does dead code actually hinder a Java app's performance?!?!

To me, if code is truly "dead", it never gets executed, so I don't see how removing it (again, except for organizational/housekeeping/code cleanup purposes) could ever improve performance.


Solution

  • It could affect a few things...

    • Size of the application
    • Memory used when application is running
    • Decreased performance on package scanning (if applicable)