# Effective Kotlin Item 55: Consider associating elements to a map

DevFeed: [Effective Kotlin Item 55: Consider associating elements to a map](<https://devfeed.tech/articles/effective-kotlin-item-55-consider-associating-elements-to-a-map-39271.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-associate>)

Published: 2021-09-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [data](<https://devfeed.tech/topics/data.md>), [Code](<https://devfeed.tech/topics/code.md>), [identifier](<https://devfeed.tech/topics/identifier.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [complexity](<https://devfeed.tech/tags/complexity.md>), [elements](<https://devfeed.tech/tags/elements.md>), [function](<https://devfeed.tech/tags/function.md>), [hashmap](<https://devfeed.tech/tags/hashmap.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [identifier](<https://devfeed.tech/tags/identifier.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [list](<https://devfeed.tech/tags/list.md>), [map](<https://devfeed.tech/tags/map.md>), [performance](<https://devfeed.tech/tags/performance.md>), [property](<https://devfeed.tech/tags/property.md>), [standard](<https://devfeed.tech/tags/standard.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This Effective Kotlin article explains why key-based lookups are usually faster with maps than lists. It covers Kotlin hashmaps, converting iterables to maps with associate and associateBy, and the requirement that map keys be unique.

## Source excerpt

How associateBy is useful to improve the performance of finding elements.