-
-
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
Check default front matter scope against symbols #8393
Check default front matter scope against symbols #8393
Conversation
Third Party Repo Profile Summary--- master
+++ PR
- Total allocated: 282.43 MB (2467827 objects)
+ Total allocated: 281.58 MB (2446531 objects)
Total retained: 37.81 MB (112069 objects) |
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.
I don't see any clear gain here: https://github.com/jekyll/jekyll/runs/1129387000?check_suite_focus=true#step:7:18
I've restarted the check-run. Let's see if that makes any difference 😉 |
The new check run has different timestamps: --- https://github.com/jekyll/jekyll/runs/1129387000?check_suite_focus=true#step:7:18
+++ https://github.com/jekyll/jekyll/runs/1129680368?check_suite_focus=true#step:7:18
- done in 32.912 seconds.
- done in 36.238 seconds.
- done in 34.763 seconds.
+ done in 29.318 seconds.
+ done in 30.575 seconds.
+ done in 30.011 seconds. But the memory usage remains the same. The takeaway is that the build job is an unreliable metric 😅 |
@jekyllbot: merge +fix |
Summary
The
type
attribute of Jekyll's core convertible classes are Symbols. i.e. Pages are:pages
, documents are the parent collection-label symbolized, etc(The exception being
Jekyll::StaticFile
andJekyll::Layout
which havetype
asnil
).Coercing a Symbol (or
nil
) to String allocates the string to memory on each call. Since this coercion in the code below is only for comparison, we can instead coerce the string values to Symbols and avoid allocating temporary strings:jekyll/lib/jekyll/frontmatter_defaults.rb
Lines 159 to 161 in 7e0f907