Enhance the performance: disable undo collection while loading a file

This reduces the amount of memory required to load a file by around half.

Close #14455
pull/14468/head
Sven Strickroth 2023-12-06 21:28:14 +01:00 committed by Don Ho
parent a51e62c16d
commit ef8ad111e9
1 changed files with 2 additions and 0 deletions

View File

@ -1594,6 +1594,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
_pscratchTilla->execute(SCI_SETREADONLY, false);
}
_pscratchTilla->execute(SCI_CLEARALL);
_pscratchTilla->execute(SCI_SETUNDOCOLLECTION, false); // disable undocollection while loading a file
if (fileFormat._language < L_EXTERNAL)
@ -1769,6 +1770,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
_pscratchTilla->execute(SCI_EMPTYUNDOBUFFER);
_pscratchTilla->execute(SCI_SETSAVEPOINT);
_pscratchTilla->execute(SCI_SETUNDOCOLLECTION, true);
if (ro)
_pscratchTilla->execute(SCI_SETREADONLY, true);