Skip to content

Conversation

@n10v
Copy link
Contributor

@n10v n10v commented Apr 6, 2017

markdownify template function needs less time now to markdownify pages.

Count of viper calls by building https://github.com/rdwatters/hugo-docs-concept

 962 publishdir
 749 pygmentscodefences
 650 defaultcontentlanguage
 645 languages
 640 builddrafts
 638 buildfuture
 638 buildexpired
 342 ignorefiles
 315 hascjklanguage
 313 enableemoji
 261 rsslimit
 261 disablerss
   9 rssuri
   5 defaultContentLanguage
   4 uglyurls
   4 theme
   4 taxonomies
   4 multilingual
   4 ignorecache
   4 defaultcontentlanguageinsubdir
   4 canonifyurls
   4 cachedir
   4 baseurl
   3 workingdir
   3 themesdir
   3 staticdir
   3 removepathaccents
   3 paginatepath
   3 layoutdir
   3 disablepathtolower
   2 workingDir
   2 themesDir
   2 contentdir
   2 blackfriday
   1 verbose
   1 uglyURLs
   1 title
   1 staticDir
   1 social
   1 sitemap
   1 sectionpagesmenu
   1 removePathAccents
   1 relativeurls
   1 relativeURLs
   1 publishDir
   1 preservetaxonomynames
   1 pluralizelisttitles
   1 permalinks
   1 params
   1 paginatePath
   1 noTimes
   1 noChmod
   1 menu
   1 logFile
   1 layoutDir
   1 languagecode
   1 i18ndir
   1 googleanalytics
   1 footnotereturnlinkcontents
   1 footnoteanchorprefix
   1 footnoteReturnLinkContents
   1 footnoteAnchorPrefix
   1 enablerobotstxt
   1 enablemissingtranslationplaceholders
   1 enablegitinfo
   1 disqusshortname
   1 disablesitemap
   1 disablekinds
   1 disablehugogeneratorinject
   1 disablePathToLower
   1 disable404
   1 defaultContentLanguageInSubdir
   1 datadir
   1 copyright
   1 cleanDestinationDir
   1 canonifyURLs
   1 cacheDir
   1 baseURL
   1 author

Performance gain: about 0.5-1 sec by building hugodocs.info on my MacBook Air 2014/1,4 GHz Intel Core i5/4 GB 1600 MHz DDR3

Updates #2728
Updates rdwatters/hugo-docs-concept#44

@bep I appreciate if you will provide benchmarks

@bep
Copy link
Member

bep commented Apr 6, 2017

In my tests it saves some allocations compared to current master, but is about the same in speed department (there is an error margin here at about 3 percent or something):

benchmark           old ns/op      new ns/op       delta
BenchmarkHugo-4     9997747579     10140845478     +1.43%

benchmark           old allocs     new allocs     delta
BenchmarkHugo-4     49446752       48760618       -1.39%

benchmark           old bytes      new bytes      delta
BenchmarkHugo-4     9442790920     9433569344     -0.10%

But I guess this depends on what feature the sites I have in my test uses.

@n10v
Copy link
Contributor Author

n10v commented Apr 6, 2017

Thank you!
Hm, then these changes only affect themes that use many markdownify functions

@bep
Copy link
Member

bep commented Apr 6, 2017

This is, of course, still worth it. I will eventually update my list of sites in my benchmark to be more representative re new features.

@n10v
Copy link
Contributor Author

n10v commented Apr 6, 2017

So can I merge it?

@n10v
Copy link
Contributor Author

n10v commented Apr 6, 2017

Merged in 8f09e5f and 260b55e

@n10v n10v closed this Apr 6, 2017
@n10v n10v deleted the viper branch April 6, 2017 19:03
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants