arrow-fx / arrow.fx.internal / Platform / maxStackDepthSize

maxStackDepthSize

const val ~~maxStackDepthSize~~: Int Deprecated: The IO datatype and it’s related type classes will disappear in Arrow 0.13.0. All useful operations are offered directly over suspend functions by Arrow Fx Coroutines. https://arrow-kt.io/docs/fx/async/

Establishes the maximum stack depth for IO#map operations.

The default is 128, from which we substract one as an optimization. This default has been reached like this:

  • according to official docs, the default stack size on 32-bits Windows and Linux was 320 KB, whereas for 64-bits it is 1024 KB
  • according to measurements chaining Function1 references uses approximately 32 bytes of stack space on a 64 bits system; this could be lower if “compressed oops” is activated
  • therefore a “map fusion” that goes 128 in stack depth can use about 4 KB of stack space

Do you like Arrow?

Arrow Org
<