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-c9b737cc8596f9421ba968e56839eb052e80e794"]]
9 <div id="change-c9b737cc8596f9421ba968e56839eb052e80e794" 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=4fe14540fa3c543fb3240acdb63aa057e259bcfb;hp=de3cf48d3aae963943dfeb3aaffb2edd6f472ef8;hb=c9b737cc8596f9421ba968e56839eb052e80e794;hpb=d6ff694ff7a6a4700ccbbd5819907eac73cf065a" 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="Sat, 20 Nov 2010 00:36:29 +0000">00:36:29 11/20/10</span></span>
27 <span class="desc"><br /></span>
31 <a href="http://ikiwiki.info/ikiwiki.cgi?rev=c9b737cc8596f9421ba968e56839eb052e80e794&do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
34 <div class="changelog">
37 one more patch: but expanding the memoization is actually a slowdown for the docwiki<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 de3cf48..4fe1454 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 @@ -43,12 +43,19 @@ Here's my patch - please consider it! -- [[KathrynAndersen]]
49 >>>>>> `/^/i` regexp that can be used without further modifiction in most
50 >>>>>> cases. --[[Joey]]
52 ->>>>>>> Done, see `smcv/ready/glob-cache`.
53 +>>>>>>> Done, see `smcv/ready/glob-cache` and `smcv/glob-cache-too-far`.
54 +>>>>>>>
55 >>>>>>> Kathryn's patch is a significant improvement; my first patch on top of
56 ->>>>>>> that is a trivial cleanup that speeds it up a little, and the other two
57 +>>>>>>> that is a trivial cleanup that speeds it up a little, and the next two
58 >>>>>>> patches (using precompiled regexes) have surprisingly little effect
59 >>>>>>> (they don't slow it down either though, so either omit them or merge
60 ->>>>>>> them, whichever). Detailed benchmark results --[[smcv]]
61 +>>>>>>> them, whichever). Detailed benchmark results below.
62 +>>>>>>>
63 +>>>>>>> Moving the memoization to `glob2re` actually seems to slow things down
64 +>>>>>>> again - I suspect the docwiki has few enough mentions of `user()` etc.
65 +>>>>>>> that caching them is a waste of time, but perhaps it's not the most
66 +>>>>>>> representative.
67 +>>>>>>> --[[smcv]]
69 --------------------------------------------------------------
71 @@ -120,9 +127,21 @@ master at time of branch:
72 7.70 1.7814 79514 0.000022 IkiWiki::PageSpec::match_glob
73 3.35 0.7756 59454 0.000013 <anon>:IkiWiki/Plugin/inline.pm:223
75 -"""]]
76 +`move memoization from match_glob to glob2re`:
78 + time elapsed (wall): 28.7677
79 + time running program: 23.9473 (83.24%)
80 + time profiling (est.): 4.8205 (16.76%)
81 + number of calls: 1360181
82 + number of exceptions: 13
84 + %Time Sec. #calls sec/call F name
85 + 13.98 3.3469 3408 0.000982 Text::Balanced::_match_tagged
86 + 8.85 2.1194 79514 0.000027 IkiWiki::PageSpec::match_glob
87 + 3.24 0.7750 59454 0.000013 <anon>:IkiWiki/Plugin/inline.pm:223
89 --[[smcv]]
90 +"""]]
92 --------------------------------------------------------------
98 <!-- c9b737cc8596f9421ba968e56839eb052e80e794 -->