Skip to content

Poor performance: not reusing regexp.MustCompile #89

Closed
@djherbis

Description

@djherbis

You should def. only use regexp.MustCompile once for each static regexp you're creating (just throw them in global vars, they are concurrent safe) see https://golang.org/pkg/regexp/#MustCompile.

Compiling every time like it is now uses up a lot of CPU.

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