Say I defined a standalone static function. No need to access any outside variables -- completely self-contained.
Are there any performance penalties/benefits to consider when defining it, or should I just stick it wherever it makes the most sense?
(This is by far the function that takes up the most CPU time, so I don't want to be inadvertently hurting myself.)
Put it wherever it makes the most sense from the point of your program organization. Static fields and methods are loaded only once per class loader. There's no way it could hurt the performance in the run time.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments