Performance of using static methods vs instantiating the class containing the methods

From here, a static call is 4 to 5 times faster than constructing an instance every time you call an instance method. However, we’re still only talking about tens of nanoseconds per call, so you’re unlikely to notice any benefit unless you have really tight loops calling a method millions of times, and you could get the same benefit by constructing a single instance outside that loop and reusing it.

Since you’d have to change every call site to use the newly static method, you’re probably better spending your time on gradually refactoring.

Leave a Comment