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

Cache HTML rewriting function signature #375

Merged
merged 1 commit into from
Aug 9, 2024
Merged

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Aug 7, 2024

This PR replaces #371 with another approach based on @lru_cache

Fix #370

Changes:

  • use @cache (an @lru_cache without max size since we want to cache all values) to cache rewriting rule function signature

@benoit74
Copy link
Collaborator Author

benoit74 commented Aug 7, 2024

Compared to the approach propose in #371, performance seems almost identical, this approach is only marginally slower (19.8 secs vs 19 secs)

@benoit74 benoit74 marked this pull request as ready for review August 7, 2024 13:25
@benoit74 benoit74 requested a review from rgaudin August 7, 2024 13:25
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ; Better rely on stdlib if we can 👍

@benoit74 benoit74 merged commit e80b30f into main Aug 9, 2024
5 checks passed
@benoit74 benoit74 deleted the fix_perf_html_cache branch August 9, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance issue linked to new "extensible" HTML rewriting rules
2 participants