In my program (Bayes classifier), I have a lot of calls to the map.size()
method.
I was wondering if the performance of the program can be optimized by storing the value of map.size()
in a local variable (or a field).
If so, what would be the right way to store it in a variable?
int mapSize = map.size();
Below the surface, this will probably just create a pointer to the method (?)