title: How to Improve performance with Jetpack Compose (when assembling something inside a @Composable function)
body: <p>Suppose I have two composables in my app:</p>
  <pre><code>@Composable
  fun CoreKeyboard(keyboardKeys: List&lt;List&lt;KeyboardKey&gt;&gt;, ...) {
      // ...
  }
  </code></pre>
  <p>and</p>
  <pre><code>@Composable
  fun NumberKeyboard(...) {
      val keyboardKeys = listOf(
          listOf(KeyboardKey(&quot;1&quot;), KeyboardKey(&quot;2&quot;), KeyboardKey(&quot;3&quot;)),
          listOf(KeyboardKey(&quot;4&quot;), KeyboardKey(&quot;5&quot;), KeyboardKey(&quot;6&quot;)),
          listOf(KeyboardKey(&quot;7&quot;), KeyboardKey(&quot;8&quot;), KeyboardKey(&quot;9&quot;)),
          listOf(KeyboardKey(&quot;0&quot;))
      )
  
      CoreKeyboard(keyboardKeys = keyboardKeys, ...)
  
  }
  </code></pre>
  <p>If I'm not wrong, this approach is not very performatic as in every recomposition the <code>keyboardKeys</code> in <code>NumberKeyboard</code> will be reassembled.</p>
  <p><strong>What is the best way to do this?</strong></p>
  <p>I thought about using <code>by remember { mutableStateOf(...) }</code>, but <code>keyboardKeys</code> is immutable. Is it still a good approach?</p>