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

improve striptags performance #413

Merged
merged 1 commit into from
Jan 19, 2024
Merged

improve striptags performance #413

merged 1 commit into from
Jan 19, 2024

Conversation

davidism
Copy link
Member

The regular expression method of finding anything between comment or tag marks can be slow on large input, especially if it doesn't contain an end mark. Instead, use some simple str.find calls to incrementally remove blocks. The code can be cleaned up in main by using := assignment expressions.

@davidism davidism added this to the 2.1.4 milestone Jan 19, 2024
@davidism davidism merged commit a24df39 into 2.1.x Jan 19, 2024
12 checks passed
@davidism davidism deleted the striptags branch January 19, 2024 21:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant