Skip to content

Regex compiled per-call in hot paths #43

Description

@windoze95

Location: internal/service/import.go:382,550 and internal/service/user.go:265-278

regexp.MustCompile is called inside function bodies (extractJSONLD, parseISO8601Duration) meaning the regex is recompiled on every call. ValidatePassword calls regexp.MatchString 4 times per validation, each compiling the regex.

Fix: move all regex compilation to package-level var statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions