Skip to content

Commit c83aa6f

Browse files
committed
Mention the takeways in the first section
1 parent 0c7aba2 commit c83aa6f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

blog/_posts/2018-02-07-collections-performance.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ After we published that blog post, the community
1515
[raised concerns](https://www.reddit.com/r/scala/comments/7g52cy/let_them_be_lazy/dqgol36/)
1616
about possible performance implications of having more levels of abstraction than before.
1717

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`.
2127

2228
For reference, the source code of the new collections is available in
2329
[this GitHub repository](https://github.com/scala/collection-strawman).
@@ -57,7 +63,7 @@ trait StrictOptimizedIterableOps[+A, +CC[_], +C] extends IterableOps[A, CC, C] {
5763
}
5864
~~~
5965

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:
6167

6268
~~~ scala
6369
trait Vector[+A] extends IndexedSeq[A]
@@ -123,7 +129,7 @@ exactly the same as in the old collections.
123129
This article studied the performance of the new collections. I’ve reported that view
124130
based operation implementations are about 25% slower than builder based implementations,
125131
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
127133
make sense for the sake of correctness.
128134

129135
I expect the new collections to be equally fast or slightly faster than the previous collections.

0 commit comments

Comments
 (0)