<?xml version="1.0" encoding="windows-1252"?>
<node id="1012018" title="Re^3: Evolving a faster filter? (code)" created="2013-01-07 06:44:33" updated="2013-01-07 06:44:33">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;Perhaps you missed the significance of the timings:&lt;code&gt;
C:\test&gt;1011850 -O=100000
Dict read at C:\test\1011850.pl line 96.
objects loaded at C:\test\1011850.pl line 106.
App created at C:\test\1011850.pl line 112.

Ovid: (optimal ordering) returned 9193 objs in 4.447958 seconds
Ovid: (pessimal ordering) returned 9193 objs in 7.236690 seconds

RichardK: (optimal ordering) returned 9193 objs in 4.065038 seconds
RichardK: (pessimal ordering) returned 9193 objs in 6.219226 seconds

BUK: returned 9193 objs in 0.760572 seconds
Filters run at C:\test\1011850.pl line 138.
&lt;/code&gt;

&lt;p&gt;Running your OP algorithm against a set of 100 filters each carefully arrange to filter an increasing number of objects and ordered best to worst, and running two tests -- optimal and pessimal -- the difference between then is less that 50%. That is the best you can hope to achieve with your order-the-filters mechanism.

&lt;p&gt;However, by altering the way the filters operate upon the objects, you can achieve an order of magnitude saving.

&lt;p&gt;Or perhaps you've just decided how you want to tackle the problem. Regardless...

&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1011650</field>
<field name="parent_node">
1012016</field>
</data>
</node>
