<div><span class="gmail_quote">On 10/23/07, <b class="gmail_sendername">Anders Nygren</b> <<a href="mailto:anders.nygren@gmail.com">anders.nygren@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
To summarize my progress on the widefinder problem<br>A few days ago I started with Steve Vinoski's tbray16.erl<br>As a baseline on my 1.66 GHz dual core Centrino<br>laptop, Linux,<br>tbray16<br>real    0m7.067s<br>user    
0m12.377s<br>sys     0m0.584s</blockquote><div><br class="webkit-block-placeholder"></div><div>Anders, thanks for collecting and posting these. I've just performed a set of new timings for all of them, as listed below. For each, I just ran this command:
</div><div><br class="webkit-block-placeholder"></div><div>time erl -smp -noshell -run <test_case> main o1000k.ap >/dev/null</div><div><br class="webkit-block-placeholder"></div><div>where "<test_case>" is the name of the tbray test case file. All were looped ten times, and I took the best timing for each. All tests were done on my 8-core 
2.33 GHz dual Intel Xeon with 2 GB RAM Linux box, in a local (non-NFS) directory.</div><div><br class="webkit-block-placeholder"></div><div>My original tbray16 runs in</div><div><br class="webkit-block-placeholder"></div>
<div><div>real    0m3.162s</div><div>user    0m16.513s</div><div>sys     0m1.762s</div></div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">I removed the dict used for the shift table,
<br>and changed the min_heap_size.<br>That gave<br>real    0m2.713s<br>user    0m4.168s<br>sys     0m0.412s<br><br>(see tbray_tuple.erl and wfbm4_tuple.erl)<br>Steve reported that it ran in ~1.9 s on his 8 core server.</blockquote>
<div><br class="webkit-block-placeholder"></div><div>What I get for tbray_tuple is:</div><div><br class="webkit-block-placeholder"></div><div>real    0m2.285s</div><div>user    0m8.615s</div><div>sys     0m0.988s</div><div>
<br> </div><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Then I removed the dicts that were used for collecting the<br>matches and used ets instead, and got some improvement
<br>on my dual core laptop.<br>real    0m2.220s<br>user    0m3.252s<br>sys     0m0.344s<br><br>(see tbray_ets.erl and wfbm4_ets.erl)<br><br>Interestingly Steve reported that it actually performed<br>worse on his 8 core server.
</blockquote><div><br class="webkit-block-placeholder"></div><div>The discrepancy seems to be gone. With your new file that you supplied in your message, the official timing for tbray_ets on the 8-core is:</div><div><br class="webkit-block-placeholder">
</div><div>real    0m1.868s</div><div>user    0m7.416s</div><div>sys     0m0.509s</div><div><br> </div><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">These versions all read the whole file into memory at the start.
<br>On my laptop that takes ~400ms (when the file is already cached<br>in the OS).<br><br>So I changed it to read the file in chucks and spawn the worker<br>after each chunk is read.<br><br>tbray_blockread with 4 processes
<br>real    0m1.992s<br>user    0m3.176s<br>sys     0m0.420s<br><br>(see tbray_blockread.erl and wfbm4_ets.erl)<br><br>Running it in the erlang shell it takes ~1.8s.</blockquote><div><br class="webkit-block-placeholder"></div>
<div>Interestingly, some of my earlier attempts tried to overlap block reads and worker spawning, but the results were always worse, so that's why I went to reading in the whole file. This blockread approach may very well be The Ultimate Wide Finder.
</div><div><br class="webkit-block-placeholder"></div><div>Timing for tbray_blockread on the 8-core:</div><div><br class="webkit-block-placeholder"></div><div>real    0m1.546s</div><div>user    0m7.337s</div><div>sys     
0m0.662s</div><div><br class="webkit-block-placeholder"></div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Just starting and stopping the VM takes<br>time erl -pa ../../bfile/ebin/ -smp -noshell -run init stop
<br><br>real    0m1.229s<br>user    0m0.208s<br>sys     0m0.020s</blockquote><div><br class="webkit-block-placeholder"></div><div>On the 8-core this takes:</div><div><br class="webkit-block-placeholder"></div><div>real    
0m1.093s</div><div>user    0m0.072s</div><div>sys     0m0.012s</div><div> </div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">It would be interesting to see how it runs on other machines,
<br>with more cores.</blockquote><div><br class="webkit-block-placeholder"></div><div>Tim Bray is traveling at the moment, but he told me by email that he hopes to get back to measuring these on the T5120 next week.</div>
<div><br class="webkit-block-placeholder"></div><div>thanks,</div><div>--steve</div></div>