1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-04 15:50:10 +01:00

Bug 765 - Delays using Edit commands and Draw Tool in long projects

A 4hr track used to take about 20s to cut a few samples. This is now significantly improved, to around 3s. Leland did this by

(a) moving the size calculation to when we examine the undo history, so it isn't slowing down the edits.
(b) in size calculation, using sizes that are cached rather than going to disk to find the sizes.
(c) writing the autosave file which is to an FFIle to a string first, i.e. using XMLStringWriter as a buffer for XMLFileWriter.

Step (c) may also make autosave marginally safer, as the risk of a partially updated autosave file is reduced.
This commit is contained in:
Leland Lucius
2015-04-07 12:20:50 +01:00
committed by James Crook
parent cedc6975e8
commit 2457579091
12 changed files with 79 additions and 88 deletions

View File

@@ -310,8 +310,12 @@ void XMLFileWriter::Write(const wxString &data)
///
/// XMLStringWriter class
///
XMLStringWriter::XMLStringWriter()
XMLStringWriter::XMLStringWriter(size_t initialSize)
{
if (initialSize)
{
Alloc(initialSize);
}
}
XMLStringWriter::~XMLStringWriter()

View File

@@ -103,7 +103,7 @@ class XMLStringWriter:public wxString, public XMLWriter {
public:
XMLStringWriter();
XMLStringWriter(size_t initialSize = 0);
virtual ~XMLStringWriter();
void Write(const wxString &data);