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

Profile various stages of a site's build process #6760

Merged
merged 12 commits into from May 21, 2020

Conversation

ashmaroli
Copy link
Member

@ashmaroli ashmaroli commented Feb 9, 2018

Outputs a table showing how much time has been spent on each stage in Site#process

Build Process Summary:
----------------------

  PHASE      |      TIME
-------------+-------------
  RESET      |    0.0000
  READ       |    0.3423
  GENERATE   |    0.0483
  RENDER     |   12.0781
  CLEANUP    |    0.0763
  WRITE      |    0.1856
-------------+-------------
 TOTAL TIME  |   12.7306

ghost
ghost previously requested changes Feb 9, 2018
lib/jekyll/site.rb Outdated Show resolved Hide resolved
@ghost ghost requested review from a team February 9, 2018 11:45
@ghost ghost dismissed their stale review February 9, 2018 11:53

Changes addressed.

@mattr-
Copy link
Member

mattr- commented Feb 12, 2018

Is there a way that we can get this out of the rendering classes and into their own classes so that we don't pollute the core function of those classes?

@ashmaroli
Copy link
Member Author

Is there a way that we can get this out of the rendering classes and into their own classes

There is an active proposal where @parkr adds a Jekyll::Profiler class.. We can move this into that class if Parker is fine with the arising conflict..

@ashmaroli
Copy link
Member Author

@mattr- Moved the methods for profiling various stages of the build process into (a new class) Jekyll::Profiler

@DirtyF
Copy link
Member

DirtyF commented May 20, 2020

How is this helpful and actionable for end-users?

Build Process Summary:

| PHASE      |   TIME |
+------------+--------+
| RESET      | 0.0003 |
| READ       | 0.3453 |
| GENERATE   | 0.0335 |
| RENDER     | 5.7318 |
| CLEANUP    | 0.1145 |
| WRITE      | 0.1663 |
+------------+--------+
| TOTAL TIME | 6.3917 |

@ashmaroli
Copy link
Member Author

How is this helpful

In the past, we had received queries from users stating that the total time calculated from the
--profile table does not tally with the total time output at the end of a build (e.g. done in 1.215s). We had to then inform the users that the --profile table only logs the :render phase. The additional time would be from IO bound stages such as reading and writing files and in some cases from multiple generators.

actionable for end-users?

Not quite for novice users. But at least they'd have greater intel on their site.
For intermediate to advanced users, the additional info might help them optimize their _plugins.

@DirtyF
Copy link
Member

DirtyF commented May 21, 2020

OK so when it's something more than 80% of users don't have to care about, it should be an opt-in, maybe with an option similar to --profile --verbose

@ashmaroli
Copy link
Member Author

an option similar to --profile --verbose

I'm not so keen on introducing another CLI switch at the moment, though..

@DirtyF
Copy link
Member

DirtyF commented May 21, 2020

@jekyll: merge +minor

@jekyllbot jekyllbot merged commit 589b122 into jekyll:master May 21, 2020
jekyllbot added a commit that referenced this pull request May 21, 2020
@ashmaroli ashmaroli deleted the profile-site-process branch May 21, 2020 10:08
@jekyll jekyll locked and limited conversation to collaborators May 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants