Chapter 8: Efficient collection processing

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 54: Prefer Sequences for big collections with more than one processing step

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Order is important

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Sequences do the minimal number of operations

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Sequences can be infinite

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Sequences do not create collections at every processing step

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

When aren’t sequences faster?

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

What about Java streams?

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Kotlin Sequence debugging

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 55: Consider associating elements to a map

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Using Maps

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Associating elements with keys

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 56: Consider using groupingBy instead of groupBy

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

groupBy

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

groupingBy

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 57: Limit the number of operations

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 58: Consider Arrays with primitives for performance-critical processing

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 59: Consider using mutable collections

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Item 60: Use appropriate collection types

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Array-based list

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Deque

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Linked lists

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Hash tables

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Sorted binary trees

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.

Summary

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/effectivekotlin.