Details
-
Improvement
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
None
-
None
Description
FBUtilities.hash() calls MessageDigest.getInstance() on every invocation, which in turns calls the synchronized method Provider.getService(). FBUtilities.md5hash() is frequently invoked from RandomPartitioner, and minor thread contention in this codepath can be observed when running contrib/py_stress against an out-of-box Cassandra installation.
One possible solution is to preallocate md5 MessageDigest instances and store them as threadlocals.