You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converting a Seq to a list on anything remotely large (even a Seq with 1000 items seems to be enough) causes a max call size exceeded error.
After tracing through the code a bit, it seems to be happening because the implementation of flatDeep is unnecessarily recursive (it iterates recursively in the default case).
The documentation and the fact that the sample had to reassign meta = meta.concat(i) suggest that this sample in fact creates 1000 nested sequences, which are lazily linked until toList forces them to materialize.
BTW a better option for bulk operations is withMutation, e.g.
List().withMutations((mutable) => {
for (let i = 0; i < 10000; ++i) {
mutable.concat(i);
}
});
What happened
Converting a Seq to a list on anything remotely large (even a Seq with 1000 items seems to be enough) causes a max call size exceeded error.
After tracing through the code a bit, it seems to be happening because the implementation of flatDeep is unnecessarily recursive (it iterates recursively in the default case).
How to reproduce
This codesandbox repros the issue: https://codesandbox.io/s/stoic-brook-zlzcs6?file=/src/index.js
The text was updated successfully, but these errors were encountered: