<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">
On 10/23/07, Anders Nygren <<a href="mailto:anders.nygren@gmail.com">anders.nygren@gmail.com</a>> wrote:<br>> 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<br>><br>> 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.
<br>><br>> 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.<br>><br>> 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.<br>><br><br>In the last email I mentioned that
<br>" 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"<br><br>But I just realized that a more useful measure for basic
<br>startup and shutdown is<br><br>time erl -pa ../../bfile/ebin/ -smp -noshell -run erlang halt<br><br>real    0m0.201s<br>user    0m0.180s<br>sys     0m0.016s</blockquote><div><br class="webkit-block-placeholder"></div>
<div>Hmm, good point. On the 8-core:</div><div><br class="webkit-block-placeholder"></div><div><div>real    0m0.090s</div><div>user    0m0.061s</div><div>sys     0m0.012s</div><br> </div>--steve</div>