jdk
8f65b852 - Performance improvement

Commit
2 years ago
Performance improvement Performance results came from my repository I mentioned in the header. The code before this PR ran in 230ms. Our previous codes ran in 1 200ms to 1800 ms with String + formatted + %n$s usage. They ran in 350ms to 380ms with String + formatted + %s usage. And in 100ms to 110ms if we replace String + format with a string concatenation. Now the code below gives the same results in 36ms and with all our expected behaviors. Since we control notation length we can bypass some controls, directly generate the color value, without generate a new string, and reject a wrong number format without generate any exception.
Parents
Loading