diff --git a/src/commands/CommandTargets.cpp b/src/commands/CommandTargets.cpp index 0fc5aeaa4..c1e2578d5 100644 --- a/src/commands/CommandTargets.cpp +++ b/src/commands/CommandTargets.cpp @@ -349,6 +349,10 @@ LongMessageDialog::LongMessageDialog(wxWindow * parent, mType = type; mAdditionalButtons = additionalButtons; 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(){ diff --git a/src/commands/CommandTargets.h b/src/commands/CommandTargets.h index c5ad18dfb..03365c170 100644 --- a/src/commands/CommandTargets.h +++ b/src/commands/CommandTargets.h @@ -231,7 +231,10 @@ public: ResponseQueueTarget() : mBuffer( wxEmptyString ) - { } + { + // Cater for handling long responses quickly. + mBuffer.Alloc(40000); + } virtual ~ResponseQueueTarget() { if( mBuffer.StartsWith("\n" ) )