haskell / haskell/containers

Think about plugging potential Data.Tree unfoldTreeM_BF space leak

Open
#199 0 comments 0 reactions 0 assignees View on GitHub
performance Tree
Dominant language
Haskell
Stars
355
Forks
194
Avg merge
3d 4h
Merged PRs (30d)
4

Description

`unfoldForestM_BF` (both the current implementation and the level-wise one in #198) has a potential space leak. In particular, we need to keep track of the number of children of each node when we dump the child seeds into the queue or concatenate them all. The implementations do this by holding on to the seed lists until it's time to rebuild, and then (one way or another) counting the seeds in each. If the seeds are large, this is potentially a problem. If we want, we can force the seed count earlier, avoiding the leak. However, I haven't yet found a way to do this that doesn't lead to performance problems.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.