开发者

Does Scala achieve good performance on Android? (June 2011)

开发者 https://www.devze.com 2023-03-10 03:59 出处:网络
I\'m very new to scala and find many of its ideas very attractive. I\'ve just discovered the scala for android project and I\'m wondering if it could be expected to run well or perhaps even better tha

I'm very new to scala and find many of its ideas very attractive. I've just discovered the scala for android project and I'm wondering if it could be expected to run well or perhaps even better than java?

Could it even be expected do some things better than java even if 开发者_C百科the processors are mostly single core in-order execution types at the moment?

If anyone has any example or experiences to share then please do!


The only "lag" would be the size of the apk, but if you use something like ProGuard it would represent only around 15k/25k more, nothing significant at all. As of performance, for what i've seen is the same. I mean, it is not worse (as happens with Clojure, being dynamically typed), but i think it's the same as Java.


Yes, it does. But to keep the package size down, use Proguard.

If you use SBT, there is already some plugin which automates the whole process.


As with most performance-related questions, the correct answer is 'It depends'. I'm no Scala expert (yet), but from what I've seen so far, it'll be future-proof - as in, build with Scala to get better / easier multicore support - as that's the trend that's rapidly popularizing, with dual- and quadcore processors quickly becoming commonplace in high-end smartphones. For single-core and 'simple' applications that don't really do much things that can be parallized, I'm guessing performance would be equal or worse. However, performance isn't everything, especially not for prototypes or one-off applications - ease of coding and development speed are more important, in which Scala, if you're familiar with it, can help (due to less code and smarter constructs).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号