dfinity / motoko-base

The Motoko base library
Apache License 2.0
483 stars 99 forks source link

Stack overflow for Heap.fromIter #578

Open chenyan-dfinity opened 1 year ago

chenyan-dfinity commented 1 year ago

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.