c*t
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
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
3 楼
Thank you veli veli much.
相关阅读
函数式语言怎么实现常用数据结构?李彦宏称"百度没有占便宜,有信心再赢一次"介绍一个woreless mesh协议栈HORNET MESH软软公开了C#三十年,中国工业软件从欣欣向荣到溃不成军 (转载)[bssd]分布式data driven products的方法论问题线性代数学的好的进来一下 (转载)无意中发现个小巨牛啊pytorch啥时候出1.0?有人用GO做过分布式计算么?辛顿非常励志Re: 码工把数据库密码传到GitHub 华住旗下酒店5亿信息疑被泄 ZT (转载)为啥我的浏览器看不了论坛里的图片!!!Python比Java到底差多少呢???码工猥琐男 应该注重 纵向的职业发展路线【bssd】又出人生导师了你们要不要第一人称写个小说大家说 xgb 价格预算之类的问题 降维会提高精度吗?你们写JAVA用月食还是intelliJ? (转载)想做一些open source的project