Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92241

Investigate if MozJS can avoid extra BSON conversions when input is already BSON

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution

      While looking into moving fuzzer comparison logic to shell helpers, I noticed that most of the time spent wasn't in comparing results, but converting the input to BSON for our shell helpers. I've seen this conversion take ~400-500ms for deeply nested objects.

      However the input to the shell helper came from a query and is already BSON. The fast-path we have to avoid the extra conversion is not taken. We should investigate why the conversions take so long and if we can avoid unnecessary conversions from BSON to a MozJS structure, back to BSON.

      Even if we don't move more logic from JS to C++, this work will still be done when we use any existing helpers in the fuzzer. Here is an example.

            Assignee:
            matt.boros@mongodb.com Matt Boros
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: