Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Consider moving constant regexes to use constants #809

Copy link
Copy link
@hasezoey

Description

@hasezoey
Issue body actions

I have recently learned that regexes get re-created *1 every time they are executed, unless they are stored in a constant, so this could (at least slightly) improve performance by not having to re-compile the regexes everytime a line is checked, though i have not measured performance..

*1 apparently it is only compiled once but every time they are executed a new regexp object is created and needs to be gb collected

MDN Guide: Regular Expressions
also see this stackoverflow thread

probably should do some measurements just to be sure, but from my slight look it should be at least somewhat better for V8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.