-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Trivial - P5
-
Affects Version/s: None
-
Component/s: Change streams
-
None
-
Query Execution
-
Fully Compatible
-
QE 2025-03-17
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In change_stream_event_transform.cpp, there are several lookup values for constant strings (vectors & sets), which are put in function-local static variables.
This means that the lookup values will be built at most once, the compiler needs to put in a guard variable to make the only-once initialization of the variables thread-safe: Link to compiler explorer
While these guard variables have low overhead, we can fully avoid them by constructing the lookup values exactly once at program startup, by moving them out of the functions into the anonymous namespace.