mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Preallocate string for aud-do
Helps marginally with speed of commands which generate long strings in many small steps.
This commit is contained in:
@@ -349,6 +349,10 @@ LongMessageDialog::LongMessageDialog(wxWindow * parent,
|
|||||||
mType = type;
|
mType = type;
|
||||||
mAdditionalButtons = additionalButtons;
|
mAdditionalButtons = additionalButtons;
|
||||||
SetName(XO("Long Message"));
|
SetName(XO("Long Message"));
|
||||||
|
// The long message adds lots of short strings onto this one.
|
||||||
|
// So preallocate to make it faster.
|
||||||
|
// Needs 37Kb for all commands.
|
||||||
|
mText.Alloc(40000);
|
||||||
}
|
}
|
||||||
|
|
||||||
LongMessageDialog::~LongMessageDialog(){
|
LongMessageDialog::~LongMessageDialog(){
|
||||||
|
|||||||
@@ -231,7 +231,10 @@ public:
|
|||||||
|
|
||||||
ResponseQueueTarget()
|
ResponseQueueTarget()
|
||||||
: mBuffer( wxEmptyString )
|
: mBuffer( wxEmptyString )
|
||||||
{ }
|
{
|
||||||
|
// Cater for handling long responses quickly.
|
||||||
|
mBuffer.Alloc(40000);
|
||||||
|
}
|
||||||
virtual ~ResponseQueueTarget()
|
virtual ~ResponseQueueTarget()
|
||||||
{
|
{
|
||||||
if( mBuffer.StartsWith("\n" ) )
|
if( mBuffer.StartsWith("\n" ) )
|
||||||
|
|||||||
Reference in New Issue
Block a user