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 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 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 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: Done
b*r
3 楼
Thank you veli veli much.
相关阅读
谁能推荐个web portal的software问个C里面计算大数的问题大家看下现在找工的要求Node vs JavaRe: 阿里:YunOS已是全球第三大手机系统 国内市场份额远远超过 (转载)uber这么挣钱,客服却跟屎一样现在所有小公司都是open space和daily scrum (转载)alphoga, sorry mistake,基于纯暴力还是knowledge base有没有人觉得restful被高估了在大公司做开源感觉怎么样? (转载)VBA能不能调用其他语言写的库/函数?mpirun vs scriptPython为啥Lexical Scoping不适用于import?如果让VBA里的IE automation更Robust?repython这中垃圾语言流行还是因为半路出家的人太多惊,朋友在digital ocean host的网站crash了。果崩了,还有木有必要学Swift?centos 7下自动安装各种CNN库Spark请教。