Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance issue w.r.t. not_out_end #311

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

bkiers
Copy link
Owner

@bkiers bkiers commented Oct 13, 2024

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)

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.

@bkiers bkiers requested a review from msangel October 13, 2024 16:41
@bkiers bkiers marked this pull request as draft October 13, 2024 18:05
@bkiers
Copy link
Owner Author

bkiers commented Oct 13, 2024

Last commit was wrong. Let me fix.

OK, done.

@bkiers bkiers marked this pull request as ready for review October 13, 2024 18:21
@msangel
Copy link
Collaborator

msangel commented Oct 14, 2024

I will publish these changes as new version

@bkiers bkiers merged commit cd54bc4 into master Oct 15, 2024
4 checks passed
@bkiers bkiers deleted the 310-fix-performance-issue-output-tag branch October 15, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template parsing performance degradation between 0.8.3.3 and 0.9.1.0
2 participants