Delay writing image cache index until after load complete

While loading all songs, disable writing the index file for the image
cache, in order to speed up loading and cache generation, similar to
how the song cache index file write is delayed.
This commit is contained in:
Tracy Ward
2019-10-12 11:24:13 -04:00
parent 2cbac72293
commit f104e813c4
3 changed files with 16 additions and 2 deletions
+4 -1
View File
@@ -158,7 +158,8 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld )
RageTimer tm;
// Tell SONGINDEX to not write the cache index file every time a song adds
// an entry. -Kyz
SONGINDEX->delay_save_cache= true;
SONGINDEX->delay_save_cache = true;
IMAGECACHE->delay_save_cache = true;
LoadStepManiaSongDir( SpecialFiles::SONGS_DIR, ld );
const bool bOldVal = PREFSMAN->m_bFastLoad;
@@ -168,6 +169,8 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld )
LoadEnabledSongsFromPref();
SONGINDEX->SaveCacheIndex();
SONGINDEX->delay_save_cache= false;
IMAGECACHE->WriteToDisk();
IMAGECACHE->delay_save_cache = false;
LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() );
}