[SERVER-86369] Optimize mongo::ExtendedCanonicalV200Generator::writeBinData Created: 07/Feb/24  Updated: 07/Feb/24

Status: Needs Scheduling
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Unresolved Votes: 0
Labels: perf-tiger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2024-02-07 at 2.46.49 PM.png    
Participants:

 Description   

The code in uses fmtlib and std::back_inserter to write out the UUID. This results in many function to fmt::v7::formatter<unsigned int, char, void>::format and fmt::v7::detail::concat as it builds the string.

            format_to(
                std::back_inserter(buffer),
                FMT_COMPILE(
                    R"({{"$uuid":"{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}"}})"),
                static_cast<uint8_t>(data[0]),
                static_cast<uint8_t>(data[1]),
                static_cast<uint8_t>(data[2]),
                static_cast<uint8_t>(data[3]),
                static_cast<uint8_t>(data[4]),
                static_cast<uint8_t>(data[5]),
                static_cast<uint8_t>(data[6]),
                static_cast<uint8_t>(data[7]),
                static_cast<uint8_t>(data[8]),
                static_cast<uint8_t>(data[9]),
                static_cast<uint8_t>(data[10]),
                static_cast<uint8_t>(data[11]),
                static_cast<uint8_t>(data[12]),
                static_cast<uint8_t>(data[13]),
                static_cast<uint8_t>(data[14]),
                static_cast<uint8_t>(data[15]));


Generated at Thu Feb 08 07:00:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.