Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2339

Reduce memory requirements for Document and BsonDocument when the number of keys is small

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • BSON
    • None

    Description

      Both Document and BsonDocument have an internal LinkedHashMap to store the entries in order.

      This is not the most efficient data structure to use when the number of entries is small.

      Consider using just an ArrayList to handle small numbers of entries, and only start using a hash table when the number of entries grows to more than a handful (size of handful TBD).

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: