Siying Dong fbbf0d1456 Pre-calculate whether to slow down for too many level 0 files
Summary: Currently in DBImpl::MakeRoomForWrite(), we do  "versions_->NumLevelFiles(0) >= options_.level0_slowdown_writes_trigger" to check whether the writer thread needs to slow down. However, versions_->NumLevelFiles(0) is slightly more expensive than we expected. By caching the result of the comparison when installing a new version, we can avoid this function call every time.

Test Plan:
make all check
Manually trigger this behavior by applying universal compaction style and make sure inserts are made slow after there are certain number of files.

Reviewers: haobo, kailiu, igor

Reviewed By: kailiu

CC: nkg-, leveldb

Differential Revision: https://reviews.facebook.net/D15141
2014-01-14 11:23:02 -08:00
..
2013-12-10 10:48:35 +02:00
2013-10-28 17:54:09 -07:00
2013-12-03 11:17:58 -08:00
2013-10-28 17:54:09 -07:00
2013-10-25 08:32:14 -07:00
2013-12-03 12:42:15 -08:00
2013-12-03 12:42:15 -08:00