diff --git a/libdevcore/LevelDB.cpp b/libdevcore/LevelDB.cpp index 74b74fafa..2a67bc5ea 100644 --- a/libdevcore/LevelDB.cpp +++ b/libdevcore/LevelDB.cpp @@ -97,7 +97,7 @@ leveldb::Options LevelDB::defaultDBOptions() { leveldb::Options options; options.create_if_missing = true; options.max_open_files = c_maxOpenLeveldbFiles; -// options.filter_policy = leveldb::NewBloomFilterPolicy( 10 ); + options.filter_policy = leveldb::NewBloomFilterPolicy( 10 ); return options; } diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 8902b8ff0..07caef242 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -1252,6 +1252,8 @@ uint64_t BlockChain::getTotalCacheMemory() { } void BlockChain::garbageCollect( bool _force ) { + boost::chrono::high_resolution_clock::time_point gcTimeStart = + boost::chrono::high_resolution_clock::now(); updateStats(); if ( !_force && chrono::system_clock::now() < m_lastCollection + c_collectionDuration && @@ -1263,6 +1265,8 @@ void BlockChain::garbageCollect( bool _force ) { m_lastCollection = chrono::system_clock::now(); + boost::chrono::high_resolution_clock::time_point gcTimeCycleStart = + boost::chrono::high_resolution_clock::now(); while ( m_lastStats.memTotal() >= c_maxCacheSize ) { Guard l( x_cacheUsage ); for ( CacheID const& id : m_cacheUsage.back() ) { @@ -1312,6 +1316,12 @@ void BlockChain::garbageCollect( bool _force ) { m_cacheUsage.push_front( std::unordered_set< CacheID >{} ); updateStats(); } + boost::chrono::high_resolution_clock::time_point gcTimeCycleFinish = + boost::chrono::high_resolution_clock::now(); + clog( VerbosityInfo, "bc" ) << "GCCT:" + << boost::chrono::duration_cast< boost::chrono::milliseconds >( + gcTimeCycleFinish - gcTimeCycleStart ) + .count(); { @@ -1324,6 +1334,12 @@ void BlockChain::garbageCollect( bool _force ) { assert( m_blockHashes.size() == 4096 ); } } + boost::chrono::high_resolution_clock::time_point gcTimeFinish = + boost::chrono::high_resolution_clock::now(); + clog( VerbosityInfo, "bc" ) << "GCT:" + << boost::chrono::duration_cast< boost::chrono::milliseconds >( + gcTimeFinish - gcTimeStart ) + .count(); } void BlockChain::clearCaches() {