[SERVER-41845] Template KeyString to be allocable on either the stack or the heap Created: 20/Jun/19  Updated: 29/Oct/23  Resolved: 31/Jul/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Daniel Solnik (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-07-15, Execution Team 2019-07-29, Execution Team 2019-08-12
Participants:

 Description   

The KeyString class uses a StackAllocator to build a buffer, which is not releasable (i.e. a full copy is required). In order to mitigate performance regressions, it will be necessary to create a version of the KeyString class with a releasable buffer in cases where it is known a KeyString::Value can be produced without a copy. We should modify KeyString so that it can be templated to have a releasable buffer or not.

Implement a release() function that is only available on a heap-allocated KeyString object, and returns an owned KeyString::Value without copying any data.



 Comments   
Comment by Githook User [ 31/Jul/19 ]

Author:

{'name': 'Daniel Solnik', 'email': 'dansolnik@gmail.com', 'username': 'Dsolnik'}

Message: SERVER-41845 Made Keystring::Builder into a template of the Buffer used.
Branch: master
https://github.com/mongodb/mongo/commit/4958cedd5023aae532f36ad451644304106fc84d

Comment by Daniel Solnik (Inactive) [ 25/Jul/19 ]

 

 

Generated at Thu Feb 08 04:58:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.