Re: static factory methods - Those are called just once (so perf isn't really the point).
With respect to non-perf reasons, Factories should also be non-static.
Here's why:
1. Factories that are part of a dependency injection framework (Guice, Dagger, Spring) are actually "objects" that the DI framework is moving around. These DI frameworks already enforce object creation (see: https://github.com/google/guice/wiki/GettingStarted for example -- everything is an object).
2. public static factory classes have significant disadvantages (eg. depending on another factory class is a direct, "hardcoded" brittle dependency). Avoiding this is straightforward - create factory objects (aka Modules) and register it with the DI framework (the only public static "singleton" object) - when an object is needed, ask for it and the DI framework will give it to you (implicitly through the factory).
With respect to non-perf reasons, Factories should also be non-static. Here's why: 1. Factories that are part of a dependency injection framework (Guice, Dagger, Spring) are actually "objects" that the DI framework is moving around. These DI frameworks already enforce object creation (see: https://github.com/google/guice/wiki/GettingStarted for example -- everything is an object). 2. public static factory classes have significant disadvantages (eg. depending on another factory class is a direct, "hardcoded" brittle dependency). Avoiding this is straightforward - create factory objects (aka Modules) and register it with the DI framework (the only public static "singleton" object) - when an object is needed, ask for it and the DI framework will give it to you (implicitly through the factory).