https://kotlinlang.org logo
Join Slack
Powered by
# kotlinx-collections-immutable
  • s

    Slackbot

    07/15/2025, 3:15 PM
    message has been deleted
  • d

    Dmitry Nekrasov

    07/15/2025, 3:20 PM
    Hello Kotlin community! We’re interested in learning about your experience with immutable collections in Kotlin projects, particularly with the
    kotlinx.collections.immutable
    library. Do you use immutable collections in your codebase - whether in pure Kotlin, Android, or Compose Multiplatform projects? If yes, how do you apply them in your workflow (e.g., state management, thread safety, etc.), and what use cases or patterns have you found most effective? Have you encountered any nuances, challenges, or limitations, and do you have any suggestions or feature requests for the library? If you don’t use immutable collections, we’d love to know why - do they not match your typical scenarios, or do you find them inconvenient or unnecessary for your use cases? Your feedback will help us understand real-world adoption and shape the evolution of Kotlin libraries. Thanks for sharing your experience!
    a
    r
    +4
    • 7
    • 8
  • d

    Dan Rusu

    07/15/2025, 4:17 PM
    Many people asked how the performance and efficiency of kotlinx immutable collections compares to Immutable Arrays so it feels like performance / efficiency is an important attribute. My response is that kotlinx immutable collections trades element-access performance for efficient modifications due to their persistent architecture. Perhaps the documentation of kotlinx immutable collections could be improved to better highlight its benefits along with scenarios where the persistent architecture really shines.
    👍 1
    d
    r
    • 3
    • 3
  • p

    PHondogo

    07/15/2025, 4:18 PM
    I'm missing buildImmutableList function. Like buildList but returning ImmutableList.
    ➕ 2
    💯 3
    👀 1
  • e

    Eric Eilebrecht

    07/15/2025, 4:39 PM
    We love the persistent/immutable collection interfaces from
    kotlinx.collections.immutable
    , but needed different implementation performance tradeoffs for our application (the Certora Prover). We ended up making "treap"-based persistent data structures based on the Kotlin interfaces (with extensions), which are better optimized for our use cases. See: Certora/collections: Memory-effficient immutable collection types for Kotlin
    👀 2
  • s

    Stefan Oltmann

    07/15/2025, 4:51 PM
    My reason to use them is to get stable Composables that use lists and sets. So I only want a recompose on my wrapper around a LazyGrid if its content changes.
    ❤️ 1
    ➕ 6
    b
    g
    • 3
    • 10