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