X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ddc9441beb0c85e1f7578f4e31c9bf5497955e5e..f24e1e0727d42291e3c625a73f4491ff717b44cc:/doc/bugs/editing_gitbranch_template_is_really_slow.mdwn diff --git a/doc/bugs/editing_gitbranch_template_is_really_slow.mdwn b/doc/bugs/editing_gitbranch_template_is_really_slow.mdwn index 028a5b2fa..d8af150c1 100644 --- a/doc/bugs/editing_gitbranch_template_is_really_slow.mdwn +++ b/doc/bugs/editing_gitbranch_template_is_really_slow.mdwn @@ -14,4 +14,18 @@ Easy to reproduce offline: * `touch templates/gitbranch.mdwn` * `/usr/bin/perl -Iblib/lib ikiwiki.in -setup docwiki.setup -refresh` +NYTProf says: + + # spent 279s (237+41.8) within IkiWiki::bestlink which was called 13988949 times, avg 20µs/call: + # 13150827 times (222s+37.2s) by IkiWiki::PageSpec::match_link at line 2692, avg 20µs/call + # 829606 times (14.9s+4.51s) by IkiWiki::PageSpec::match_link at line 2687, avg 23µs/call + ... + sub bestlink ($$) { + +which is about half the execution time (458s on my laptop). + +Adding code to log each call to match_backlink indicates that a large part +of the problem is that it evaluates the pagespec +`backlink(plugins/goodstuff)` up to a million times, with various pages and locations. + --[[smcv]]