Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What standard optimization refactoring can I do to my Java application?

I have a semi big Java application. It's written quite poorly and I suspect there are quite a lot of simple things I can do that will clean things up a bit and improve performance.

For example I recently found the

String.matches(regex)

function used quite a lot in loops with the same regex. So I've replaced that with precompiled Patterns. I use FindBugs (which is great BTW) but that didn't spot this problem and I'm limited on tools that I can use here at work.

Is there anything else simple like this that I should look at?

like image 417
graveca Avatar asked Dec 08 '22 08:12

graveca


1 Answers

Have a look at these differents tools:

  • FindBugs (you already did it).
  • Checkstyle
  • PMD
  • ...

I suggest also to have a look at Sonar, which is a great wrapper for all these tools.

All these tools are free!

Globally, they will not help you to improve the performance, but the quality of the code.

like image 104
Romain Linsolas Avatar answered Dec 26 '22 00:12

Romain Linsolas