Java.
I have a very small int array (4 elements).
What's the fastest way to get max value? All values will be between 0 and 255.
Also int array is faster than byte array? Is casting much of a hit?
What's the fastest way to get sum of all values?
The reason I ask is cause this is a major bottleneck in a program I inherited. They aren't slow per say, but the guy is calling these methods many many times and it adds up. Eventually I need to rewrite the entire thing, but looking for some quick tricks to speed this up in the short term.