Hi,There's an interesting benchmarks circulating lately:The benchmark is sort of comparing libraries, rather than languages, but I think 2 things are sticking out of it in regards to the apparent poor performance of Scala:1. collections really need specialization, as working with primitives is really common and the price paid for boxing primitives is a performance killer2. Scala's Views are really terrible - which is odd for a standard library of an FP language exposing immutable collections as the defaultI was wondering if there are plans to address the above.
I found it a bit of a pity that that benchmark only seems to include Double => Double transformation pipelines. A reader could wrongly draw the conclusion that Java lambdas are faster in general, which isn’t the case.
Under Scala 2.11 -Xexperimental, you can actually use the Java 8 streams API directly using Scala lambda syntax, so x => x * x
can be treated as a java.util.function.DoubleFunction
, rather than Function1<Int, Int>
. You can then profit from the selective, hand specialization of the Java 8 streams API.
That’s nice. Personally I also don’t like hand specialization, because once in a standard library it’s permanent and it doesn’t cover everything. Java’s collections are still not specialized either, you still have to use a third-party library like Trove.
I would prefer a generic approach.Scala has @specialized
but it has many problems. I played with miniboxing and seems promising. Are there any plans for it to replace @specialized
and to use it against Scala’s collections?
That’s nice. Personally I also don’t like hand specialization, because once in a standard library it’s permanent and it doesn’t cover everything. Java’s collections are still not specialized either, you still have to use a third-party library like Trove.
I would prefer a generic approach.Scala has
@specialized
but it has many problems. I played with miniboxing and seems promising. Are there any plans for it to replace@specialized
and to use it against Scala’s collections?
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If I may ask, what is the roadmap for 2.12? Is it summarized anywhere online? There are only 4 tickets on github marked with a 2.12 milestone, so I assume that isn't it.It was probably discussed on this or another scala mailing list before I subscribed...
It is still too early to say if/when we could switch to this approach. I'd suggest that 2.13 would be the first opportunity, as we've got a full roadmap for 2.12.