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

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      None

      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).

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

              Created:
              Updated:
              Resolved: