Skip to content

noticeably slower than core regexp #79

@stevenh

Description

@stevenh

Gave this a go with our patterns which are processing a huge file of log entries and it's unfortunately significantly slower.

It could be I need a config but thought you would be interested in the example.

The code uses these regexps:

		idPattern:      regexp.MustCompile(`^(\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-fA-F]{32})$`),
		phpPattern:     regexp.MustCompile(`^/.*[\w-]+\.php`),

It uses a simple:

idPattern.MatchString(path)
phpPattern.MatchString(path)

With core regexp it takes ~1m21s to process 10m lines, with coregex it takes 1m35s.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions