-
Type: New Feature
-
Resolution: Unresolved
-
Priority: 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.