Skip to content

Commit

Permalink
IS-862 swt grow
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Sep 20, 2023
1 parent a443111 commit bd483e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libdevcore/LevelDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
16 changes: 16 additions & 0 deletions libethereum/BlockChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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() ) {
Expand Down Expand Up @@ -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();


{
Expand All @@ -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() {
Expand Down

0 comments on commit bd483e9

Please sign in to comment.