]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Use more efficient hash map for deadlock detection
authorManuel Ung <mung@fb.com>
Sat, 19 Nov 2016 19:34:26 +0000 (11:34 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Sat, 19 Nov 2016 19:39:15 +0000 (11:39 -0800)
commite63350e726d62144037d889c348cf007deda7a80
treed5abf13f23b048a1839525f754fbeead4db983fa
parenta13bde39ee0231aa88baec5a7f7c2d6325238c1c
Use more efficient hash map for deadlock detection

Summary:
Currently, deadlock cycles are held in std::unordered_map. The problem with it is that it allocates/deallocates memory on every insertion/deletion. This limits throughput since we're doing this expensive operation while holding a global mutex. Fix this by using a vector which caches memory instead.

Running the deadlock stress test, this change increased throughput from 39k txns/s -> 49k txns/s. The effect is more noticeable in MyRocks.
Closes https://github.com/facebook/rocksdb/pull/1545

Differential Revision: D4205662

Pulled By: lth

fbshipit-source-id: ff990e4
util/hash_map.h [new file with mode: 0644]
utilities/transactions/transaction_lock_mgr.cc
utilities/transactions/transaction_lock_mgr.h