Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5935

Remove potentially redundant creation of Long class when parsing Date()

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON, Performance
    • 3
    • Not Needed
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • Not Needed

      First suggested here: https://github.com/mongodb/js-bson/pull/611#issuecomment-1942706746

      Use Case

      As a BSON user
      I want Dates to decode as quickly as possible
      So that my app is more resonsive

      User Impact

      • Performance improvement for parsing Dates

      Dependencies

      • None

      Unknowns

      • The Long's construction and toNumber() calls appear redundant but do they provide value?
        • toNumber has some form of implicit truncation and precision loss
        • Note: JS Date's cannot be greater than 8640000000000000 nor less than -8640000000000000

      Acceptance Criteria

      Implementation Requirements

      • Parse Dates without creating a throw-away Long object

      Testing Requirements

      • Ensure Date's are constructed correctly and without extraneous objects

      Documentation Requirements

      • None

      Follow Up Requirements

      • None

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: