summaryrefslogtreecommitdiff
path: root/doc/recentchanges/change_98d0883c8949e6cde8db019bb282d5fa815ffc1a._change
blob: 1ca5dd2b1249e6c4491402b5147289a511e47643 (plain)
  1. [[!meta author="""http://smcv.pseudorandom.co.uk/"""]]
  2. [[!meta authorurl="""http://smcv.pseudorandom.co.uk/"""]]
  3. [[!meta title="""change to todo/Improving_the_efficiency_of_match__95__glob on ikiwiki"""]]
  4. [[!meta permalink="http://ikiwiki.info/recentchanges/#change-98d0883c8949e6cde8db019bb282d5fa815ffc1a"]]
  5. <div id="change-98d0883c8949e6cde8db019bb282d5fa815ffc1a" class="metadata">
  6. <span class="desc"><br />Changed pages:</span>
  7. <span class="pagelinks">
  8. <a href="http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/todo/Improving_the_efficiency_of_match__95__glob.mdwn;h=c4d3a8ecb07bd1722646aba5a3eddfc4b2866fb6;hp=ff9784dd163c255867ba9958827447472fb20350;hb=98d0883c8949e6cde8db019bb282d5fa815ffc1a;hpb=f942c2db05e4da9188f36c5df1d42aea709208bf" title="diff" rel="nofollow">[[diff|wikiicons/diff.png]]</a><a href="http://ikiwiki.info/ikiwiki.cgi?page=todo%2FImproving_the_efficiency_of_match__95__glob&amp;do=goto" rel="nofollow">todo/Improving the efficiency of match&#95;glob</a>
  9. </span>
  10. <span class="desc"><br />Changed by:</span>
  11. <span class="committer">
  12. <a href="http://smcv.pseudorandom.co.uk/" rel="nofollow">smcv</a>
  13. </span>
  14. <span class="desc"><br />Commit type:</span>
  15. <span class="committype">web</span>
  16. <span class="desc"><br />Date:</span>
  17. <span class="changedate"><span class="relativedate" title="Sun, 14 Nov 2010 12:50:31 -0400">12:50:31 11/14/10</span></span>
  18. <span class="desc"><br /></span>
  19. </div>
  20. <span class="revert">
  21. <a href="http://ikiwiki.info/ikiwiki.cgi?rev=98d0883c8949e6cde8db019bb282d5fa815ffc1a&amp;do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
  22. </span>
  23. <div class="changelog">
  24. branches imported into git; benchmark results<br />
  25. </div>
  26. <div class="diff">
  27. <pre>
  28. diff --git a/doc/todo/Improving_the_efficiency_of_match__95__glob.mdwn b/doc/todo/Improving_the_efficiency_of_match__95__glob.mdwn
  29. index ff9784d..c4d3a8e 100644
  30. --- a/doc/todo/Improving_the_efficiency_of_match__95__glob.mdwn
  31. +++ b/doc/todo/Improving_the_efficiency_of_match__95__glob.mdwn
  32. @@ -15,6 +15,11 @@ Here&#39;s my patch - please consider it! -- &#91;&#91;KathrynAndersen&#93;&#93;
  33. &gt;&gt;&gt; rather than /$re/ so I think that would make sense.
  34. &gt;&gt;&gt; -- &#91;&#91;KathrynAndersen&#93;&#93;
  35. +&gt;&gt;&gt;&gt; Git branch `smcv/ka-glob-cache` has Kathryn&#39;s patch. Git
  36. +&gt;&gt;&gt;&gt; branch `smcv/memoize-glob2re` does as I suggested, which
  37. +&gt;&gt;&gt;&gt; is less verbose than Kathryn&#39;s patch but also not as
  38. +&gt;&gt;&gt;&gt; fast; I&#39;m not sure why, tbh. --&#91;&#91;smcv&#93;&#93;
  39. +
  40. --------------------------------------------------------------
  41. Benchmarks done with Devel::Profile on the same testbed IkiWiki setup. I&#39;m just showing the start of the profile output, since that&#39;s what&#39;s relevant.
  42. @@ -51,6 +56,72 @@ Note that the seconds per call for match_glob in the &quot;after&quot; case has gone down
  43. K.A.
  44. --------------------------------------------------------------
  45. +
  46. +A second set of benchmarks, done by rebuilding the docwiki at commit f942c2db05e4
  47. +like so:
  48. +
  49. + perl -Iblib/lib -d:Profile ikiwiki.in -setup docwiki.setup --no-verbose
  50. +
  51. +The docwiki appears to use fewer glob matches than Kathryn&#39;s wiki.
  52. +
  53. +With master:
  54. +
  55. + time elapsed (wall): 29.6970
  56. + time running program: 24.6930 (83.15%)
  57. + time profiling (est.): 5.0041 (16.85%)
  58. + number of calls: 1359180
  59. + number of exceptions: 13
  60. +
  61. + %Time Sec. #calls sec/call F name
  62. + 13.62 3.3629 3406 0.000987 Text::Balanced::_match_tagged
  63. + 10.84 2.6773 79442 0.000034 IkiWiki::PageSpec::match_glob
  64. + 3.08 0.7598 59454 0.000013 &lt;anon&gt;:IkiWiki/Plugin/inline.pm:223
  65. + 3.07 0.7593 29830 0.000025 IkiWiki::bestlink
  66. + 2.99 0.7378 10231 0.000072 IkiWiki::PageSpec::match_link
  67. +
  68. +With my `smcv/memoize-glob2re` branch:
  69. +
  70. + time elapsed (wall): 30.4931
  71. + time running program: 25.1248 (82.39%)
  72. + time profiling (est.): 5.3683 (17.61%)
  73. + number of calls: 1439943
  74. + number of exceptions: 13
  75. +
  76. + %Time Sec. #calls sec/call F name
  77. + 13.19 3.3146 3406 0.000973 Text::Balanced::_match_tagged
  78. + 8.41 2.1123 79442 0.000027 IkiWiki::PageSpec::match_glob
  79. + 3.97 0.9979 86905 0.000011 Memoize::_memoizer
  80. + 3.05 0.7654 59454 0.000013 &lt;anon&gt;:IkiWiki/Plugin/inline.pm:223
  81. + 3.02 0.7576 29830 0.000025 IkiWiki::bestlink
  82. +
  83. +and in a repeated run:
  84. +
  85. + 8.40 2.0905 79442 0.000026 IkiWiki::PageSpec::match_glob
  86. +
  87. +With Kathryn&#39;s patch as seen in my `smcv/ka-glob-cache` branch:
  88. +
  89. + time elapsed (wall): 27.7567
  90. + time running program: 22.9941 (82.84%)
  91. + time profiling (est.): 4.7627 (17.16%)
  92. + number of calls: 1279946
  93. + number of exceptions: 13
  94. +
  95. + %Time Sec. #calls sec/call F name
  96. + 14.29 3.2867 3406 0.000965 Text::Balanced::_match_tagged
  97. + 7.89 1.8136 79442 0.000023 IkiWiki::PageSpec::match_glob
  98. + 3.30 0.7577 59454 0.000013 &lt;anon&gt;:IkiWiki/Plugin/inline.pm:223
  99. + 3.24 0.7461 29830 0.000025 IkiWiki::bestlink
  100. + 3.19 0.7332 143 0.005127 ? IkiWiki::pagespec_match_list
  101. +
  102. +and in a repeated run:
  103. +
  104. + 7.84 1.8253 79442 0.000023 IkiWiki::PageSpec::match_glob
  105. +
  106. +--&#91;&#91;smcv&#93;&#93;
  107. +
  108. +--------------------------------------------------------------
  109. +
  110. +
  111. &lt;pre&gt;
  112. diff --git a/IkiWiki.pm b/IkiWiki.pm
  113. index 08a3d78..c187b98 100644
  114. </pre>
  115. </div>
  116. <!-- 98d0883c8949e6cde8db019bb282d5fa815ffc1a -->