public class PerfTest {
@Test
public void test() throws Exception {
int repeat = 100;
TemplateParser templateParser = new TemplateParser.Builder().build();
long start = System.currentTimeMillis();
for (int i = 0; i < repeat; i++) {
templateParser.parse(new File("./src/test/test.liquid"));
}
System.out.printf("%d ms.", System.currentTimeMillis() - start);
}
}
when not_out_end was:
not_out_end
: ( ~OutEnd )+
;
the test ran in around 8000-8500 ms. With the changes in this PR the test ran in around 3000-3200 ms.
Fixes #310
I tested this by adding
./src/test/test.liquid
with the contents from the issue #310 (https://github.com/user-attachments/files/17264247/test_template_string.txt)when
not_out_end
was:the test ran in around 8000-8500 ms. With the changes in this PR the test ran in around 3000-3200 ms.