-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Optimize parsing of parameters in include tag #8192
Merged
jekyllbot
merged 6 commits into
jekyll:master
from
ashmaroli:optimize-includes-params-parsing
Sep 14, 2020
Merged
Optimize parsing of parameters in include tag #8192
jekyllbot
merged 6 commits into
jekyll:master
from
ashmaroli:optimize-includes-params-parsing
Sep 14, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How can we measure the gain here? |
@DirtyF I've added a benchmark script to this branch as well.. You can run it by checking the PR branch out locally: git fetch upstream pull/8192/head:optimize-includes-params-parsing
git checkout optimize-includes-params-parsing
ruby benchmark/parse-include-tag-params.rb |
I am missing some gems here, can you copy-paste the output of the benchmark please? |
@DirtyF ref: https://travis-ci.org/github/ashmaroli/jekyll/builds/689225401
|
DirtyF
approved these changes
May 20, 2020
@jekyllbot: merge +fix |
jekyllbot
added a commit
that referenced
this pull request
Sep 14, 2020
This was referenced Mar 12, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
while..do
loop generatingMatchData
with fasterString#scan
and a block to use meaningful local variable names.String#gsub
duplicates the input string irrespective of a match, test if substitution is necessary before callingString#gsub
. (The overhead for prior testing is negligible.)