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

For Codec decoding, optimize code path for looking up Codec based on a BsonType

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.3.0
    • Component/s: BSON, Performance
    • Labels:
      None
    • Sprint:
      JVM Sprint 31

      Description

      For Document, BsonDocument, and DBObject Codec.decode implementations, there is a code path for looking up the Codec for a value that requires two lookups in a Map; first by one in BsonTypeClassMap, then followed by one in CodecCache. This could easily be turned into a single lookup in an array that has an entry for each BsonType and a value which is the Codec to use for that BsonType.

      Performance benchmarks show that the performance gains would be significant for simple documents.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: