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

Optimize the url filter by using non-capturing regex groups #2918

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

borissmidt
Copy link

@borissmidt borissmidt commented Jan 19, 2025

It seems especially the URL_PATTERN couldn't be optimized by the regex compiler because all groups are capturing.

I was originally looking at the golang ide console speed and there one of the heavy filter plugins is the GoConsoleFilter but i can't really update the code to try the differences.

But i see the complictated regex where not all matching groups are used. So i suspect this gives a similar issue to the URL regex change i do here.

(this is in the GoConsoleFilter)

MESSAGE_PATTERN = Pattern.compile("(?:^|\\s)(?<slog>source=)?(?<filename>\\S+\\.\\w+):(?<line>\\d+)(:(?<col>\\d+))?(?=[:\\s]|$).*");

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.

1 participant