From 3332c9451ebd3ec436afd84380628dc413dcf1b0 Mon Sep 17 00:00:00 2001 From: James Crook Date: Fri, 21 Feb 2020 15:38:49 +0000 Subject: [PATCH] Slightly faster parsing of Nyquist programs. This reads the program into a buffer first. It also preallocates space for the Nyquist program. --- src/effects/nyquist/Nyquist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index d19bc1999..093f8d8d0 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2177,6 +2177,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream) wxTextInputStream pgm(stream, wxT(" \t"), wxConvAuto()); mCmd = wxT(""); + mCmd.Alloc(10000); mIsSal = false; mControls.clear(); mCategories.clear(); @@ -2261,7 +2262,8 @@ or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n .") void NyquistEffect::ParseFile() { - wxFileInputStream stream(mFileName.GetFullPath()); + wxFileInputStream rawStream(mFileName.GetFullPath()); + wxBufferedInputStream stream(rawStream, 10000); ParseProgram(stream); }