-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.0
-
Component/s: Internal, Performance
-
None
QueryResult uses a list to store items, which results in excessive memory usage and unnecessary CPU load.
Indeed, the MongoIterable API is streaming oriented with the functions forEach and iterator, it does not require the use of a list in the background.
In addition, this prevents the use of reusable objects in a ThreadLocal to limit the creation of these and further improve the memory footprint.