-
-
Notifications
You must be signed in to change notification settings - Fork 15k
str::contains is very slow for substring checks #25483
Copy link
Copy link
Closed
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Originally found in SO question.
This Rust code
Executes for up to three minutes on my machine (even with
-C opt-level=3), while the equivalent Ruby or Python code:finishes in several seconds. Java variant finishes almost instantly (but that seems to be due to JIT optimizations).
It looks like that pattern searching for substrings could be severely optimized.