Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
Description
The bsoncore.Document#Elements and bsoncore.Array#Values functions return []Element and []Value, respectively. This API offers convenience at the expense of memory efficiency as it requires all Value/Element structs to be allocated at once.
For use cases where memory management is critical, it might be worth adding Iterator types that return a single Value/Element at a time, thereby limiting the amount of memory that needs to be allocated at one point.