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

Use Regexp#match? when MatchData is not required #8427

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

ashmaroli
Copy link
Member

  • This is a 🔨 code refactoring.

Summary

Regexp#match? is the faster alternative from Ruby 2.4 when the MatchData object is not consequently utilized.

While the first build after running jekyll clean won't have files in the dest-dir, consequent builds will have the directory populated. So this line could get executed numerous times especially in a site with numerous pages and files

@ashmaroli ashmaroli requested a review from DirtyF October 8, 2020 12:14
@ashmaroli ashmaroli added this to the 4.2 milestone Oct 8, 2020
Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

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

All green, jekyll site seems to compile a little bit faster, memory allocation is still mostly Kramdown and Nokogiri.

@DirtyF DirtyF added the micro-optimization Matters only if it is a very large site ¯\_(ツ)_/¯ label Oct 8, 2020
@ashmaroli
Copy link
Member Author

memory allocation is still mostly kramdown and nogikiri

Allocations from Nokogiri will reduce when they release v1.11.0..

@ashmaroli
Copy link
Member Author

@jekyllbot: merge +fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fix frozen-due-to-age micro-optimization Matters only if it is a very large site ¯\_(ツ)_/¯
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants