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

Make HostAndPort BSON-appendable to avoid unnecessary allocation

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch

      As it stands, serializing HostAndPort into a log message requires allocating memory for a string, then passing that to get copied into a BSONObjBuilder. This results in an unnecessary allocation every time we want to log a HostAndPort. If we were able to create a HostAndPort function that takes in BSONObjBuilder& and appends, we could take this pathway in the logv2 JSONFormatter.

            Assignee:
            Unassigned Unassigned
            Reporter:
            blake.oler@mongodb.com Blake Oler
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: