Skip to content

Poor performance on html files #108

@jpramosi

Description

@jpramosi

Hello, at first I would like to thank you for the project!
I've found an issue with the html rewriter: The problem is a new regex is compiled every time lol-html its rewriter handler is called here.
Moving the regex instance to a static variable like here improves the rewriting time for an average html file from ~2 seconds to 50-200 milliseconds on some pages.
The result is that the initial page loads much faster with no noticeable delay.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions