SERVER-138113ClosedFixed

Improve ResultMaterializer efficiency

Result materializer can be improved, for example when building a document we can check if we can use the BSON base and then add fields on top of it, instead of building the full document from scratch Also can reuse "absl::InlinedVector<char, 32> visited" across produce() calls so we don't allocate on every row. Also use dynamic_bitset instead of vector

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc1025
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.