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

Patch for cheerio performance #354

Merged
merged 1 commit into from Jan 22, 2024
Merged

Patch for cheerio performance #354

merged 1 commit into from Jan 22, 2024

Conversation

vejja
Copy link
Collaborator

@vejja vejja commented Jan 19, 2024

Fixes #341

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This is a first pass at mitigating cheerio performance issues reported in #341.
Instead of parsing and recombining multiple times the same HTML, we now parse it only once upfront, and recombine it at the end.

It is unlikely to be the best approach as we may prefer to not use Cheerio anymore and instead re-implement via regexes.
I'm proposing this patch as a quick fix in the meantime so that Cloudflare users can mitigate issues.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

Copy link

vercel bot commented Jan 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nuxt-security ✅ Ready (Inspect) Visit Preview Jan 19, 2024 3:22pm

@vejja vejja marked this pull request as ready for review January 19, 2024 15:28
@Baroshem
Copy link
Owner

Awesome work @vejja

Let's merge it for 1.1.0 and test it there and possibly release it this week :)

@Baroshem Baroshem changed the base branch from main to chore/1.1.0 January 22, 2024 11:00
@Baroshem Baroshem merged commit 9a27ee4 into chore/1.1.0 Jan 22, 2024
5 checks passed
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 optimization opportunity
2 participants