Analyse BSON\Document::toCanonicalExtendedJSON performance

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • None
    • 🔵 Done
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      json_encode($document->toPHP(['root' => 'array'])) is 4x faster than $document->toCanonicalExtendedJSON()

      Even if they don't produce the same output, their purpose and performance should be very similar.

      Related: https://github.com/mongodb/mongo-php-library/pull/1169#discussion_r1333978256

            Assignee:
            Andreas Braun
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: