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

Introduce a string view type to IDL

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: IDL, Performance
    • Server Programmability
    • v8.0
    • Service Arch 2024-05-13
    • 200

      The current IDL string type is an owned string, so deserializing it requires a copy/allocation. We should introduce a new string view type (name TBD) that allows for copyless-deserialization for improved performance.

      Its a little bit less clear as to whether this should be a pure view type or whether it can be a view-or-value, akin to BSONObj. The benefit of the latter is that it allows code that is creating an IDL struct from scratch (rather than deserializing from a document which it can use as an anchor) to set the string-view field to an owned string and not have to worry about anchoring or keeping the source string alive.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: