-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
perf(external_link): drop cheerio and use regex #3685
perf(external_link): drop cheerio and use regex #3685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@segayuu I am thinking is it worthy. In this PR I drop cheerio, completely rewrite this part use regex and |
This PR drops cheerio (along with its deps) and replace it with even less LOC than before. The way I see it, this is equivalent to >99% reduction of LOC. In this case, I'm certain regex+replace can perform at least as fast as cheerio. LOC reduction + no loss in performance = 💯% worth it. |
* refactor(external_link): drop cheerio and use regex * test(external_link): rel attribute test cases * test(external_link): add attributes test cases * refactor(open_graph): avoid duplicate noopenner
What does it do?
Drop cheerio in
external_link()
helper for better performance.How to test
Screenshots
The performance increased by nearly
1%
.Pull request tasks