@@ -15,9 +15,15 @@ After we published that blog post, the community
15
15
[ raised concerns] ( https://www.reddit.com/r/scala/comments/7g52cy/let_them_be_lazy/dqgol36/ )
16
16
about possible performance implications of having more levels of abstraction than before.
17
17
18
- This blog article gives more information about the overhead of the
19
- collections’ view-based design and our solution to remove that
20
- overhead.
18
+ This blog article:
19
+
20
+ - gives more information about the overhead of the collections’
21
+ view-based design and our solution to remove that overhead,
22
+ - argues that for correctness reasons it is still better to have
23
+ view-based default implementations,
24
+ - shows that we should expect the new collections to be equally fast
25
+ or faster than the old collections, and reports an average speedup
26
+ of 35% in the case of ` Vector ` ’s ` filter ` , ` map ` and ` flatMap ` .
21
27
22
28
For reference, the source code of the new collections is available in
23
29
[ this GitHub repository] ( https://github.com/scala/collection-strawman ) .
@@ -57,7 +63,7 @@ trait StrictOptimizedIterableOps[+A, +CC[_], +C] extends IterableOps[A, CC, C] {
57
63
}
58
64
~~~
59
65
60
- Then, to implement the ` Vector ` collection, we just mix the above trait:
66
+ Then, to implement the ` Vector ` collection, we just mix such a “strict optimized” trait:
61
67
62
68
~~~ scala
63
69
trait Vector [+ A ] extends IndexedSeq [A ]
@@ -123,7 +129,7 @@ exactly the same as in the old collections.
123
129
This article studied the performance of the new collections. I’ve reported that view
124
130
based operation implementations are about 25% slower than builder based implementations,
125
131
and I’ve explained how we restored builder based implementations on strict collections.
126
- Last but not least, I’ve shown that defaulting to the view based implementations does
132
+ Last but not least, I’ve shown that defaulting to view based implementations does
127
133
make sense for the sake of correctness.
128
134
129
135
I expect the new collections to be equally fast or slightly faster than the previous collections.
0 commit comments