Currently mongo calls wiredtiger_crc32c_func() every time it needs to compute a hash: https://github.com/mongodb/mongo/blob/3ab41506ca75092c5d71877791b5b07016c2d160/src/mongo/rpc/op_msg.cpp#L77. I attempted to do something similar and was crushed by the cost of the cpuid instruction that was executing on every call. We should either cache the result in a static in that function so that it is fast to call in a loop.
If that is unacceptable or impossible for some reason, we should create a SERVER ticket to build a wrapper that does the caching.
- related to
-
SERVER-54722 Improve Sorter checksumming
- Closed