Last active
August 29, 2015 14:22
-
-
Save wjdp/6de9b798f8e24118e5e6 to your computer and use it in GitHub Desktop.
Jekyll build profiling
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
module Jekyll | |
class Site | |
def render | |
relative_permalinks_deprecation_method | |
payload = site_payload | |
collections.each do |label, collection| | |
collection.docs.each do |document| | |
t1 = Time.now | |
if true | |
document.output = Jekyll::Renderer.new(self, document).run | |
end | |
t2 = Time.now | |
puts page_or_post.path + ": " + (t2-t1).to_s | |
end | |
end | |
payload = site_payload | |
[posts, pages].flatten.each do |page_or_post| | |
puts page_or_post.path | |
t1 = Time.now | |
if true | |
page_or_post.render(layouts, payload) | |
end | |
t2 = Time.now | |
puts document.path + ": " + (t2-t1).to_s | |
end | |
rescue Errno::ENOENT | |
# ignore missing layout dir | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment