b*******r 发帖数: 311 | | c*****t 发帖数: 1879 | 2 You can improve this code significantly without much more typing.
1. When you know the size, just use simple array, int[].
It's significantly faster without having to create
extra objects, calling a number of functions (including
inside the implementation as well).
2. Avoid autoboxing. It calls about 2+ functions and create
an object (a very expensive operation), both are
significantly slower.
3. Use StringBuffer to significantly reduce the memory usage
and runs significantly
【在 b*******r 的大作中提到】 : Done
| b*******r 发帖数: 311 | 3 Thank you veli veli much. |
|