-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
OK, so this one is a little weird, but bear with me! If the argument of fromList is a good producer, then it is not an actual list in memory. So what? So if we take its length, that forces its realization as a list. If we don't take its length, then we have all sorts of other options, all of which are (typically) better. For example, we can build a list of SmallArrays holding chunks of, say, 32 elements each, and then concatenate them all in the end. That's inefficient, but less inefficient than what we do now.
For SmallArray, an option I thought about long ago is to use classic array doubling, and then shrink the final result. This will work just fine even if there is an actual list in memory.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels