(no commit message)
[ikiwiki] / doc / recentchanges / change_98d0883c8949e6cde8db019bb282d5fa815ffc1a._change
1 [[!meta author="""http://smcv.pseudorandom.co.uk/"""]]
2
3 [[!meta authorurl="""http://smcv.pseudorandom.co.uk/"""]]
4
5 [[!meta title="""change to todo/Improving_the_efficiency_of_match__95__glob on ikiwiki"""]]
6
7 [[!meta permalink="http://ikiwiki.info/recentchanges/#change-98d0883c8949e6cde8db019bb282d5fa815ffc1a"]]
8
9 <div id="change-98d0883c8949e6cde8db019bb282d5fa815ffc1a" class="metadata">
10 <span class="desc"><br />Changed pages:</span>
11 <span class="pagelinks">
12
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&amp;do=goto" rel="nofollow">todo/Improving the efficiency of match&#95;glob</a>
14
15
16 </span>
17 <span class="desc"><br />Changed by:</span>
18 <span class="committer">
19
20 <a href="http://smcv.pseudorandom.co.uk/" rel="nofollow">smcv</a>
21
22 </span>
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>
28 </div>
29
30 <span class="revert">
31 <a href="http://ikiwiki.info/ikiwiki.cgi?rev=98d0883c8949e6cde8db019bb282d5fa815ffc1a&amp;do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
32 </span>
33
34 <div class="changelog">
35
36
37 branches imported into git; benchmark results<br />
38
39
40 </div>
41
42 <div class="diff">
43 <pre>
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&#39;s my patch - please consider it! -- &#91;&#91;KathrynAndersen&#93;&#93;
49  &gt;&gt;&gt; rather than /$re/ so I think that would make sense.
50  &gt;&gt;&gt; -- &#91;&#91;KathrynAndersen&#93;&#93;
51  
52 +&gt;&gt;&gt;&gt; Git branch `smcv/ka-glob-cache` has Kathryn&#39;s patch. Git
53 +&gt;&gt;&gt;&gt; branch `smcv/memoize-glob2re` does as I suggested, which
54 +&gt;&gt;&gt;&gt; is less verbose than Kathryn&#39;s patch but also not as
55 +&gt;&gt;&gt;&gt; fast; I&#39;m not sure why, tbh. --&#91;&#91;smcv&#93;&#93;
56 +
57  --------------------------------------------------------------
58  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.
59  
60 @@ -51,6 +56,72 @@ Note that the seconds per call for match_glob in the &quot;after&quot; case has gone down
61  K.A.
62  
63  --------------------------------------------------------------
64 +
65 +A second set of benchmarks, done by rebuilding the docwiki at commit f942c2db05e4
66 +like so:
67 +
68 +    perl -Iblib/lib -d:Profile ikiwiki.in -setup docwiki.setup --no-verbose
69 +
70 +The docwiki appears to use fewer glob matches than Kathryn&#39;s wiki.
71 +
72 +With master:
73 +
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
79 +
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     &lt;anon&gt;: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
86 +
87 +With my `smcv/memoize-glob2re` branch:
88 +
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
94 +
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     &lt;anon&gt;:IkiWiki/Plugin/inline.pm:223
100 +     3.02    0.7576    29830   0.000025     IkiWiki::bestlink
101 +
102 +and in a repeated run:
103 +
104 +     8.40    2.0905    79442   0.000026     IkiWiki::PageSpec::match_glob
105 +
106 +With Kathryn&#39;s patch as seen in my `smcv/ka-glob-cache` branch:
107 +
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
113 +
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     &lt;anon&gt;: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
120 +
121 +and in a repeated run:
122 +
123 +     7.84    1.8253    79442   0.000023     IkiWiki::PageSpec::match_glob
124 +
125 +--&#91;&#91;smcv&#93;&#93;
126 +
127 +--------------------------------------------------------------
128 +
129 +
130  &lt;pre&gt;
131  diff --git a/IkiWiki.pm b/IkiWiki.pm
132  index 08a3d78..c187b98 100644
133
134 </pre>
135 </div>
136
137 <!-- 98d0883c8949e6cde8db019bb282d5fa815ffc1a -->