summaryrefslogtreecommitdiffstats
path: root/commands/hugo.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-10-04 22:12:51 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-10-07 18:00:07 +0200
commit5800a20a258378440e203a6c4a4343f5077755df (patch)
treedca1bd5030dccd56b4e9ad2dc1e037955aa4e20d /commands/hugo.go
parente2e8bcbec34702a27047b91b6b007a15f1fc0797 (diff)
metrics: Detect partialCached candidates
This commit adds a "cache potential" column when running `hugo --templateMetrics --templateMetricsHints`. This is only calculated when `--templateMetricsHints` is set, as these calculations has an negative effect on the other timings. This gives a value for partials only, and is a number between 0-100 that indicates if `partial` can be replaced with `partialCached`. 100 means that all execution of the same partial resulted in the same output. You should do some manual research before going "all cache".
Diffstat (limited to 'commands/hugo.go')
-rw-r--r--commands/hugo.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go
index d2bf18c47..2c6e3ffef 100644
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -242,6 +242,7 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) {
cmd.Flags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program")
cmd.Flags().Bool("templateMetrics", false, "display metrics about template executions")
+ cmd.Flags().Bool("templateMetricsHints", false, "calculate some improvement hints when combined with --templateMetrics")
cmd.Flags().Bool("pluralizeListTitles", true, "pluralize titles in lists using inflect")
cmd.Flags().Bool("preserveTaxonomyNames", false, `preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")`)
cmd.Flags().BoolP("forceSyncStatic", "", false, "copy all files when static is changed.")
@@ -477,6 +478,7 @@ func (c *commandeer) initializeFlags(cmd *cobra.Command) {
"noTimes",
"noChmod",
"templateMetrics",
+ "templateMetricsHints",
}
// Remove these in Hugo 0.23.