3 ms·
How does this perform in the real world? Last year, I wanted to try writing an Android app in Scala, but I was thrown off by the supposed performance implicatio
by finishingmove 12y ago
How does this perform in the real world? Last year, I wanted to try writing an Android app in Scala, but I was thrown off by the supposed performance implications. I suppose the situation with Clojure on Android is similar. Some insight from anyone who's done at least a medium-sized app this way would be greatly appreciated.
- unlogic 12y agoAuthor here. There are certain performance issues, in both loading time and memory consumption. There were efforts to make Clojure runtime smaller, but they are kind of suspended for now. I revived my old lean compiler code and for basic Hello World application on my OnePlus I reached 2.8 sec startup time and ~10 MB heap usage. I consider this a good start if further optimizations are applied (like treeshaking), but in this I rely on community (and specifically Clojure/core team) to pick up the idea.
- finishingmove 12y agoHi, thanks for the reply! I think that, even though Java 8 is getting some nice features, alternatives like this are very worth pursuing. I've seen the tutorial and the LOC reduction is impressive, which speaks loads about the expressiveness gains of Clojure.
- frowaway001 12y agoThere are no performance implications for Scala apps.
- finishingmove 12y agoAccording to this source, there are: http://blogs.microsoft.co.il/dorony/2014/10/07/scala-performance-tips-on-android/ http://blogs.microsoft.co.il/dorony/2014/10/07/scala-perform...
- frowaway001 12y agoI think that's a bit different. Scala – just like Java – allows you to write inefficient code. The Android's GC is pretty poor, so things you might have gotten away with when programming on the JVM in Java or Scala might require another thought on Dalvik. But there is nothing in Scala which would make it slower etc. than Java. Both languages generate bytecode. Clojure is different here, because it more or less needs to boot-strap its runtime before it executes code.