summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5813 from viktorklang/wip-improve-await-docs-√Seth Tisue2017-04-042-26/+59
|\ | | | | Improving ScalaDoc for ExecutionContexts
| * Improving ScalaDoc for ExecutionContext and Await.Viktor Klang2017-03-292-26/+59
| |
* | Merge pull request #5817 from ashawley/java-converters-typoSeth Tisue2017-03-311-6/+6
|\ \ | | | | | | Fix typo in JavaConverters doc
| * | Fix typo in JavaConverters docAaron S. Hawley2017-03-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | There is no such thing as scala.collection.mutable.concurrent.Map error: object concurrent is not a member of package scala.collection.mutable Introduced in 2908236a
* | | Merge pull request #5802 from jrudolph/jr/w/ListBuffer-isEmpty-nonEmptyLukas Rytz2017-03-301-0/+4
|\ \ \ | |_|/ |/| | Implement ListBuffer.isEmpty / nonEmpty / head efficiently
| * | Implement ListBuffer.isEmpty / nonEmpty efficientlyJohannes Rudolph2017-03-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Uses the extra length information to provide more efficient implementations. Evaluating these methods turns up with about 5-6% of akka-http message parsing.
* | | `def run(log: ProcessLogger, connectInput: Boolean): Process` doesn't block ↵Pablo Fco. Pérez Hidalgo2017-03-241-4/+3
| | | | | | | | | | | | | | | | | | until the spawned process exits neither does it return its exit code.
* | | Merge pull request #5778 from som-snytt/issue/10225som-snytt2017-03-231-331/+283
|\ \ \ | |/ / |/| | SI-10225 Either docs compile
| * | SI-10225 Either evinces good styleSom Snytt2017-03-211-58/+54
| | | | | | | | | | | | Per Seth.
| * | SI-10225 Either docs compileSom Snytt2017-03-141-317/+273
| | | | | | | | | | | | | | | | | | | | | | | | But without tut support, who knows. Boy scout aligns stars and updates several examples that didn't infer types in a way that compiles.
* | | Improve List creation in BatchingExecutorJohannes Rudolph2017-03-221-1/+1
| | | | | | | | | It turned up in play profiling.
* | | Merge pull request #5771 from som-snytt/issue/regex-doc-errSeth Tisue2017-03-211-16/+30
|\ \ \ | |/ / |/| | Fix and improve Regex doc
| * | Fix and improve Regex docSom Snytt2017-03-101-16/+30
| | | | | | | | | | | | | | | | | | As reported by @djvulee, there was an error in the example explaining the confusing behavior of `MatchIterator`. It's really confusing.
* | | Merge pull request #5755 from rorygraves/2.12.x_map4Jason Zaugg2017-03-142-2/+2
|\ \ \ | |/ / |/| | Improve the performance of Map4 to HashMap and Set4 to HashSet transitions
| * | Performance improvements for Map4 to HashMap nad Set4 to HashSet transitionsRory Graves2017-03-042-2/+2
| |/
* | Merge pull request #5719 from retronym/ticket/10187Adriaan Moors2017-03-101-2/+10
|\ \ | | | | | | SI-10187 Support mutation of mutable.HashMap in getOrElseUpdate
| * | SI-10187 Support mutation of mutable.HashMap in getOrElseUpdateJason Zaugg2017-03-031-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala 2.12.1 included optimizations to `HashMape.getOrElseUpdate` to avoid recomputing the index in the hash table when adding an the element. However, this index could be stale if the callback added elements to the map and triggered a resize. This commit checks that the table is unchanged before reusing the index, restoring the 2.12.0 behaviour.
* | | Merge pull request #5600 from paplorinc/HashTable_indexSeth Tisue2017-03-063-18/+5
|\ \ \ | |_|/ |/| | Further small HashTable optimizations
| * | Optimized HashTable.nextPositivePowerOfTwoPap Lőrinc2017-02-183-18/+5
| |/
* / SD-256 enable colored output by default on unixAntoine Gourlay2017-02-211-0/+6
|/ | | | | | | | | `scala.color` now has 3 states: `true`, `false` and `auto` (the default). `auto` allows colors if not on windows and if the shell is interactive (as in, both stdin and stdout are a tty). The autodetect works as expected when run via SBT too, and it can always be overriden on the CLI or via JAVA_OPTS.
* Merge branch '2.12.x' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-178-66/+106
|\
| * Merge pull request #5693 from markusjura/lineStream-warningsSeth Tisue2017-02-171-2/+2
| |\ | | | | | | Changing deprecation warning to lineStream
| | * Changing deprecation warning to lineStreamMarkus Jura2017-02-131-2/+2
| | | | | | | | | | | | | | | | | | The deprecation text of `ProcessBuilder.lines(log: ProcessLogger)` and `ProcessBuilder.lines_!(log: ProcessLogger) mentions to use the method `stream` and `stream_!` respectively. These methods do not exists. The text has been changed to use `lineStream` and `lineStream_!` respectively.
| * | Merge pull request #5697 from som-snytt/issue/10164Seth Tisue2017-02-171-8/+8
| |\ \ | | | | | | | | SI-10164 BitSet.tail zigs where it zagged
| | * | SI-10164 BitSet.tail zigs where it zaggedSom Snytt2017-02-141-8/+8
| | |/ | | | | | | | | | | | | A cut/paste issue, an increment was held over from head, which scans forward, to tail, which scans backward.
| * | Merge pull request #5674 from Philippus/issue/9519Adriaan Moors2017-02-161-24/+0
| |\ \ | | | | | | | | SI-9519 removed the usecase section of the ++-method
| | * | SI-9519 removed the usecase section of the ++-methodPhilippus Baalman2017-02-041-24/+0
| | | |
| * | | Merge pull request #5687 from retronym/ticket/10177Adriaan Moors2017-02-161-0/+27
| |\ \ \ | | | | | | | | | | SI-10177 Override lazy operations to preserve TrieMap's semantics
| | * | | SI-10177 Override lazy operations to preserve TrieMap's semanticsJason Zaugg2017-02-101-0/+27
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling .iterator on a TrieMap gives a read-only snapshot. This then extends to most inherited implementations written in terms of .iterator. However, some inherited methods, such as .values, either defer the call to .iterator or call it more than once. This results in subsequent mutations to the original map being visible I reviewed the inherited implementations from MapLike and found we needed overrides of `values`, `keySet`, `filterKeys`, and `mapValues`. Like `iterator`, these now create a read-only snapshot.
| * | | Merge pull request #5589 from allisonhb/feature/si-4700Adriaan Moors2017-02-161-0/+27
| |\ \ \ | | | | | | | | | | SI-4700 The thrilling continuation to the infix type printing saga.
| | * | | SI-4700 Make infix notation default for symbolic types.allisonhb2016-12-141-18/+24
| | | | | | | | | | | | | | | | | | | | Add ability to disable this via the @showAsInfix annotation.
| | * | | SI-4700 Add `@infix` annotation for type printingVlad Ureche2016-09-191-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` scala> import scala.annotation.infix import scala.annotation.infix scala> @infix class &&[T, U] defined class $amp$amp scala> def foo: Int && Boolean = ??? foo: Int && Boolean ```
| * | | | Merge pull request #5679 from som-snytt/issue/sliding-docAdriaan Moors2017-02-162-30/+41
| |\ \ \ \ | | | | | | | | | | | | Nuance doc for sliding
| | * | | | Nuance doc for slidingSom Snytt2017-02-072-30/+41
| | | |/ / | | |/| | | | | | | | | | | | Attempt to clarify how final element is handled.
| * | | | Merge pull request #5696 from SethTisue/bootstrap-no-parsers-no-swingAdriaan Moors2017-02-141-2/+1
| |\ \ \ \ | | | | | | | | | | | | during bootstrap, don't build scala-parser-combinators or -swing
| | * | | | during bootstrap, don't build scala-parser-combinators or -swingSeth Tisue2017-02-131-2/+1
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I see no further reason to include them in the bootstrap process. Adriaan agrees (in-person discussion). note that the community build makes sure the modules still compile as we make changes to Scala. as for actually publishing scala-parser-combinators and scala-swing when we make binary incompatible changes to Scala, I think it's fine to consider that properly the job of the module maintainers, rather than properly the job of this script. (if we want more automation on that, we could make some elsewhere, keeping that concern separate from actual bootstrapping concerns.) scala-xml, scala-partest, and scalacheck (commented out at the moment) remain in this script since they are all actually still part of the bootstrapping picture. fixes https://github.com/scala/scala-dev/issues/302 , so that integrate-bootstrap will pass again (currently it fails, since scala-parser-combinators merged Scala.js support)
* | | | | Merge commit '0965028809' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-165-42/+265
|\ \ \ \ \
| * | | | | Handle WrappedArray the same way as ArrayOps for binary compatibilityStefan Zeiger2017-02-031-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce a package-private superclass with the overridden implementations. This is public at the bytecode level, so it needs to be whitelisted.
| * | | | | Optimised implementation of List.filter/filterNotRory Graves2017-01-282-0/+106
| | | | | |
| * | | | | Optimize slice and take in ArrayOps, WrappedArrayMike Skells2017-01-282-10/+113
| | | | | | | | | | | | | | | | | | | | | | | | use Array block copy operations rather than builder/iterator
| * | | | | Avoid creating ListBuffer in List.mapConserveRory Graves2017-01-281-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Jason Zaugg <jzaugg@gmail.com>
| * | | | | Fix the size of the stack used by RedBlackTree.iteratorFrom.Sébastien Doeraene2017-01-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `s.c.i.RedBlackTree.TreeIterator` uses a stack of nodes that need to be processed later. This stack is implemented as an `Array`, which is allocated with the maximum size that can possibly be used, based on properties of red-black trees. This was added in 72ec0ac869a29fca9ea0d45a3f70f1e9e1babaaf. At the time, there was no `iteratorFrom` method, and as the comment in that commit says, the deepest nodes were never added to the stack, hence the final `- 1` in computing the maximum stack size. However, this changed with the introduction of `iteratorFrom` in 62bc99d3b20a7b37a977b19a6202cdac474eb5f6. The method `startFrom` used to initialize the iterator at the right `start` node does push the deepest nodes in some cases. This internal bug got unnoticed because `pushNext` (originally `pushPath`) has some error recovery in case the stack size got miscalculated. This has performance impacts, though, since an exception is thrown and caught. More importantly, this error recovery mechanism does not work in Scala.js, which considers `ArrayIndexOutOfBoundsException` to be undefined behavior. This commit fixes the stack size computation by simply removing the `- 1` term. To minimize risks on Scala/JVM, the error recovery mechanism is left untouched.
| * | | | | Merge pull request #5615 from ↵Stefan Zeiger2017-01-092-11/+44
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | monkey-mas/modify-ArrayBuilder-reusability-bug-2016-12-24 [Backport] Modify ArrayBuilder and WrappedArrayBuilder to be reusable
| | * | | | | [Backport] Modify ArrayBuilder and WrappedArrayBuilder to be reusableMasaru Nomura2016-12-282-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As they're reusable in 2.12.x with this change[1], it'd be useful to make them reusable in 2.11.x. [1] https://github.com/scala/scala/commit/6eaae1b969b68ed3dc65a40613a8168b09246256 With this change, not only are they reusable but also we can avoid mutation of previously created arrays. Behaviour(Problem): Actual behaviour before this modification is as follows; <ArrayBuilder> ``` scala> import scala.collection.mutable.ArrayBuilder import scala.collection.mutable.ArrayBuilder scala> val builder = new ArrayBuilder.ofInt builder: scala.collection.mutable.ArrayBuilder.ofInt = ArrayBuilder.ofInt scala> builder ++= Vector.range(1, 17) res0: builder.type = ArrayBuilder.ofInt scala> val arr = builder.result() arr: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) scala> builder.clear() scala> builder += 100 res2: builder.type = ArrayBuilder.ofInt scala> val arr2 = builder.result() arr2: Array[Int] = Array(100) scala> arr res3: Array[Int] = Array(100, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) // arr should be Array(1, .., 16) but was unexpectedly mutated by `+=` operation ``` `arr` was mutated as follows; 1. `result` & `clear` - `arr = elems` - `size = 0` 2. `+=(100)` - `ensureSize(0 + 1)` => `capacity < size || capacity == 0` is `false` as `capacity == 16` and `size == 1` - `elems(0) = 100` this is where `arr(0) = 100` was done because we did not reallocate a new array for `elems` when calling `ensureSize`, which should have happened. - `size = 1` 3. `result` - `mkArray(1)` gives us `arr2 = Array(100)` <WrappedArrayBuilder> We can observe almost the same mutation behaviour of ArrayBuilder. ``` scala> import scala.collection.mutable.WrappedArray import scala.collection.mutable.WrappedArray scala> import scala.collection.mutable.WrappedArrayBuilder import scala.collection.mutable.WrappedArrayBuilder scala> import scala.reflect.ClassTag import scala.reflect.ClassTag scala> val builder = new WrappedArrayBuilder(ClassTag.Int) builder: scala.collection.mutable.WrappedArrayBuilder[Int] = scala.collection.mutable.WrappedArrayBuilder@56cbfb61 scala> builder ++= Vector.range(1, 17) res0: builder.type = scala.collection.mutable.WrappedArrayBuilder@56cbfb61 scala> builder.result() res1: scala.collection.mutable.WrappedArray[Int] = WrappedArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) scala> builder.clear() scala> builder += 100 res3: builder.type = scala.collection.mutable.WrappedArrayBuilder@56cbfb61 scala> res1 res4: scala.collection.mutable.WrappedArray[Int] = WrappedArray(100, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) scala> builder.result() res5: scala.collection.mutable.WrappedArray[Int] = WrappedArray(100) ``` Solution: We should reset `capacity` to `0` when calling `result` so that `ensureSize(1)` calls `resize(16)`, which satisfies the property of Builder reusability. Besides mutation of previously created arrays does not happen.
| * | | | | | Simplify HashTable.index furtherPap Lőrinc2017-01-051-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 26c87f1af4cac782911500d6b143681ecdcef8ad)
| * | | | | | Changed HashMap.getOrElseUpdate to only calculate the index oncePap Lőrinc2017-01-051-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://issues.scala-lang.org/browse/SI-10049 Since `groupBy` uses this method extensively and suffered a measurable slowdown in `2.12.0`, this modification restores (and exceeds) its original speed. --- included benchmarks: (`ns/op` → smaller is better) `before (2.12.0):` ```java Benchmark (size) Mode Cnt Score Error Units s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 865.693 ± 7.869 ns/op s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 3095.657 ± 56.438 ns/op s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 28247.005 ± 470.513 ns/op s.c.mutable.HashMapBenchmark.get 10 avgt 20 679.448 ± 11.809 ns/op s.c.mutable.HashMapBenchmark.get 100 avgt 20 7240.178 ± 61.734 ns/op s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95725.127 ± 2373.458 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 836.561 ± 20.085 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 7891.368 ± 56.808 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 97478.629 ± 1782.497 ns/op s.c.mutable.HashMapBenchmark.put 10 avgt 20 243.422 ± 2.915 ns/op s.c.mutable.HashMapBenchmark.put 100 avgt 20 5810.927 ± 60.054 ns/op s.c.mutable.HashMapBenchmark.put 1000 avgt 20 82175.539 ± 1690.296 ns/op ``` `after:` ```java Benchmark (size) Mode Cnt Score Error Units s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 627.007 ± 9.718 ns/op s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2086.955 ± 19.042 ns/op s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 19515.234 ± 173.647 ns/op s.c.mutable.HashMapBenchmark.get 10 avgt 20 683.977 ± 11.843 ns/op s.c.mutable.HashMapBenchmark.get 100 avgt 20 7345.675 ± 41.092 ns/op s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95085.926 ± 1702.997 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 503.208 ± 2.643 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5526.483 ± 28.262 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 69265.900 ± 674.958 ns/op s.c.mutable.HashMapBenchmark.put 10 avgt 20 252.481 ± 7.597 ns/op s.c.mutable.HashMapBenchmark.put 100 avgt 20 5708.034 ± 110.360 ns/op s.c.mutable.HashMapBenchmark.put 1000 avgt 20 82051.378 ± 1432.009 ns/op ``` i.e. for the given benchmark conditions `~40%` faster `groupBy` and `getOrElseUpdate` (cherry picked from commit b67ca7dc6bb84758f9c9f64d68b0b11c20995aa0)
| * | | | | | Changed hashing bit rotation to use Integer.rotateRightPap Lőrinc2017-01-052-19/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit bc912230129d68466474bcc6c99356b44f65c3c2)
| * | | | | | Changed modulo to bitwise AND in hash calculationPap Lőrinc2017-01-051-52/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 7952525e7119282ec8308a0076db54923f95dc21)
| * | | | | | Optimized HashTable.indexPap Lőrinc2017-01-051-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (`ops/s`, smaller is better) `Before (9c5d3f8)`: ```scala [info] # Run complete. Total time: 00:08:15 [info] [info] Benchmark (size) Mode Cnt Score Error Units [info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 645.594 ± 9.435 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2084.216 ± 37.814 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 19878.481 ± 262.404 ns/op [info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 689.941 ± 5.850 ns/op [info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7357.330 ± 45.956 ns/op [info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95767.200 ± 1550.771 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 509.181 ± 2.683 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5563.301 ± 32.335 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 71965.365 ± 1809.738 ns/op [info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 247.270 ± 3.972 ns/op [info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5646.185 ± 106.172 ns/op [info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 81303.663 ± 954.938 ns/op ``` `Changed modulo to bitwise and in hash calculation (4c729fe)`: ```scala [info] Benchmark (size) Mode Cnt Score Error Units [info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 631.291 ± 9.269 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2077.885 ± 59.737 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 15458.278 ± 317.347 ns/op [info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 678.013 ± 4.453 ns/op [info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7258.522 ± 76.088 ns/op [info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 94748.845 ± 1226.120 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 498.042 ± 5.006 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5243.154 ± 110.372 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 68194.752 ± 655.436 ns/op [info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 257.275 ± 1.411 ns/op [info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5318.532 ± 152.923 ns/op [info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 79607.160 ± 651.779 ns/op ``` `Optimized HashTable.index (6cc1504)`: ```scala [info] Benchmark (size) Mode Cnt Score Error Units [info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 616.164 ± 4.712 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2034.447 ± 14.495 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 14712.164 ± 119.983 ns/op [info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 679.046 ± 6.872 ns/op [info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7242.097 ± 41.244 ns/op [info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95342.919 ± 1521.328 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 488.034 ± 4.554 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 4883.123 ± 59.268 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 65174.034 ± 496.759 ns/op [info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 267.983 ± 1.797 ns/op [info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5097.351 ± 104.538 ns/op [info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 78772.540 ± 543.935 ns/op ``` Summary, i.e. the effect of this PR, according to the benchmarks: * `groupBy` has a `~35%` speedup * `get` didn't change * `getOrElseUpdate` has a `~10%` speedup * `put` has a `~3%` speedup Note: caching the `exponent` to a local private field (`Byte` or `Int`) didn't have any performance advantage (only a minor slowdown was measured, possibly because it's accessed via an interface now) (cherry picked from commit a5014447861a5678c8b595e235019bb8fec098a7)
| * | | | | | SI-8774 Null link fields in mutable hash maps on removal.Carsten Varming2017-01-053-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 9a2486087a9739108265e7830ebaa96373605d02)