Use Buffer equals when comparing ObjectId

XMLWordPrintableJSON

    • 2
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/js-bson/pull/287

      This PR updates ObjectId #equals to use internal Node.js buffer #equals function when comparing two ObjectId objects.

      While tracing performance issue in our MongoDB based app, I found #equals was calling toString() when comparing two ObjectId, which turns out to be quite inefficient. In our own testing this change appears to be much, much faster when comparing two ObjectIds.

            Assignee:
            Neal Beeken
            Reporter:
            Alexander Golin (Inactive)
            None
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: