I have some methods which allow me to lookup some identifiers, so essentially the run an SQL query and pass back a value.
Currently they are not static. Would it make sense to make them static, from a performance point of view i.e. have less in memory and save the time that is required to instantiate the object? Or are these considerations not really important.
There's no significant difference in practice, one way or another. It's especially true in your case, since SQL queries will take much more time than java method call.
As for memory usage, by making method static you're gonna gain 0 bytes of memory, that's absolutely certain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With