motoko-base icon indicating copy to clipboard operation
motoko-base copied to clipboard

Stack overflow for Heap.fromIter

Open chenyan-dfinity opened this issue 1 year ago • 0 comments

The current Heap.fromIter/heapify gets stack overflow when there are more than 100k elements: https://github.com/dfinity/canister-profiling/pull/70.

We need to either 1) rewrite the join function with an accumulator; or 2) enable tail modulo cons optimization.

chenyan-dfinity avatar Jul 23 '23 21:07 chenyan-dfinity