-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specialize Scala collections (Vector, in particular) #4495
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4495?orig=1 |
Kipton Barros (kbarros) said: |
@rklaehn said: |
@soc said (edited on Aug 18, 2012 12:47:00 PM UTC): This could be done without emitting specialized bytecode for primitive types, it would need a TypeTag instead. |
Harshad (hrj) said: I (naively) imagine that this could be implemented by having a compiler flag called, say, --emit which can take three values: all, specialized-only, generic-only. The default would be all. While compiling the scala standard library, the scripts would use generic-only in the first run, and then specialized-only in the second run. For most other libraries, default would work fine. |
Out of scope for Scala 2 |
= problem =
Scala 2.9 RC1 has been released, and there are still no collections that have been specialized as far as I can tell from the source. Missing specialization for Vector in particular is a problem because the overhead of storing an Integer instead of an Int is about 5x on a 64 bit JVM, and Vector is the most performant collection we have.
I understand adding specialization everywhere would create code bloat, but just adding it to Vector alone (and not even IndexedSeqLike and such) would greatly reduce the memory consumption of these classes.
The text was updated successfully, but these errors were encountered: