Introduce a string view type to IDL

XMLWordPrintableJSON

    • Server Programmability
    • v8.1, v8.0
    • Service Arch 2024-05-13
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated: