Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Template matching use in function. #590

Merged
merged 2 commits into from
Feb 8, 2025

Conversation

bosd
Copy link
Collaborator

@bosd bosd commented Dec 19, 2024

Use pythons in function for template matching of keywords.
We only need to know if the keywords is thee.
We don't need the advanced features and addicitional cost of regexes.

in function is python is generally much faster then a regular expression.
https://stackoverflow.com/questions/19911508/python-speed-for-in-vs-regular-expression

@bosd bosd added the performance Performance label Dec 19, 2024
@bosd bosd force-pushed the template-match-in branch from 24a8a67 to 188913e Compare February 7, 2025 20:23
bosd added 2 commits February 7, 2025 22:12
Pythons in method can be a lot faster instead of finding it with a regex.
Accoring to the Pycon talk about regex performance, the built in is 1360% faster.
@bosd bosd force-pushed the template-match-in branch from 188913e to 44ff370 Compare February 7, 2025 21:12
@bosd bosd merged commit 5b67987 into invoice-x:master Feb 8, 2025
13 checks passed
@bosd bosd deleted the template-match-in branch February 8, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant