Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-589

Export mongocrypt_binary_t

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Needed

      Scope

      • Export definition of mongocrypt_binary_t so consumers do not need to use mongocrypt_binary_data and mongocrypt_binary_len.

      Motivation

      Languages interfacing with libmongocrypt may observe slower throughput with frequent calls to C functions. Using the struct definition directly may improve performance for libmongocrypt operations.

      DRIVERS-2581 identifies a problematic workload: decrypting documents with 1500 encrypted values.

      Profiling showed mongocrypt_binary_data and mongocrypt_binary_len including significant samples.

      A prototype benchmark showed improvement by using the struct definition directly, rather than calling mongocrypt_binary_data and mongocrypt_binary_len:

      run_test 'Baseline' ... begin
      Baseline   (ms): 9.868333
      Decrypting (ms): 35.971542
      Overhead   (ms): 26.103209
      Overhead   (+%): 264.51487804475187
      run_test 'Baseline' ... end
      run_test 'With Java using mongocrypt_binary_t definition' ... begin
      Baseline   (ms): 9.756125
      Decrypting (ms): 31.031459
      Overhead   (ms): 21.275334
      Overhead   (+%): 218.071560173737
      run_test 'With Java using mongocrypt_binary_t definition' ... end
      

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: