4 ms·
From the article: New features in the 2.11 series This release contains all of the bug fixes and improvements made in the 2.10 series, as well as: Collection
by thescrewdriver 13y ago
From the article:
New features in the 2.11 series
This release contains all of the bug fixes and improvements made in the 2.10 series, as well as:
Collections
Immutable HashMaps and HashSets perform faster filters, unions, and the like, with improved structural sharing (lower memory usage or churn).
Mutable LongMap and AnyRefMap have been added to provide improved performance when keys are Long or AnyRef (performance enhancement of up to 4x or 2x respectively).
BigDecimal is more explicit about rounding and numeric representations, and better handles very large values without exhausting memory (by avoiding unnecessary conversions to BigInt).
List has improved performance on map, flatMap, and collect.
See also Deprecation above: we have slated many classes and methods to become final, to clarify which classes are not meant to be subclassed and to facilitate future maintenance and performance improvements.
Modularization
The core Scala standard library jar has shed 20% of its bytecode. The modules for xml, parsing, swing as well as the (unsupported) continuations plugin and library are available individually or via scala-library-all. Note that this artifact has weaker binary compatibility guarantees than scala-library – as explained above.
The compiler has been modularized internally, to separate the presentation compiler, scaladoc and the REPL. We hope this will make it easier to contribute. In this release, all of these modules are still packaged in scala-compiler.jar. We plan to ship them in separate JARs in 2.12.x.
Reflection, macros and quasiquotes
Please see this detailed changelog that lists all significant changes and provides advice on forward and backward compatibility.
See also this summary of the experimental side of the 2.11 development cycle.
#3321 introduced Sprinter, a new AST pretty-printing library! Very useful for tools that deal with source code.
Back-end
The GenBCode back-end (experimental in 2.11). See @magarciaepfl’s extensive documentation.
A new experimental way of compiling closures, implemented by @JamesIry. With -Ydelambdafy:method anonymous functions are compiled faster, with a smaller bytecode footprint. This works by keeping the function body as a private (static, if no this reference is needed) method of the enclosing class, and at the last moment during compilation emitting a small anonymous class that extends FunctionN and delegates to it. This sets the scene for a smooth migration to Java 8-style lambdas (not yet implemented).
Branch elimination through constant analysis #2214
Compiler Performance
Incremental compilation has been improved significantly. To try it out, upgrade to sbt 0.13.2-M2 and add incOptions := incOptions.value.withNameHashing(true) to your build! Other build tools are also supported. More info at this sbt issue – that’s where most of the work happened. More features are planned, e.g. class-based tracking.
We’ve been optimizing the batch compiler’s performance as well, and will continue to work on this during the 2.11.x cycle.
Improve performance of reflection SI-6638
IDE * Numerous bug fixes and improvements!
REPL
The bytecode decompiler command, :javap, now works with Java 7 SI-4936 and has sprouted new options SI-6894 (Thanks, @som-snytt!)
Added command :kind to help to tell ground types from type constructors. #2340 (Thanks, George Leontiev and Eugene Yokota!)
The interpreter can now be embedded as a JSR-166 Scripting Engine SI-874. (Thanks, Raphael Jolly!)
Warnings * Warn about unused private / local terms and types, and unused imports, under -Xlint. This will even tell you when a local var could be a val.
Slimming down the compiler
The experimental .NET backend has been removed from the compiler.
Scala 2.10 shipped with new implementations of the Pattern Matcher and the Bytecode Emitter. We have removed the old implementations.
Search and destroy mission for ~5000 chunks of dead code. #1648