From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f4006c440754467b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.post.ch!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Wide Finder in Ada? Date: Mon, 12 Nov 2007 08:57:10 +0100 Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) Message-ID: <47380779$1@news.post.ch> References: <1194831460.619945.188980@v3g2000hsg.googlegroups.com> NNTP-Posting-Host: 194.41.146.1 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: atlas.ip-plus.net 1194854269 17484 194.41.146.1 (12 Nov 2007 07:57:49 GMT) X-Complaints-To: abuse@ip-plus.net NNTP-Posting-Date: Mon, 12 Nov 2007 07:57:49 +0000 (UTC) User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <1194831460.619945.188980@v3g2000hsg.googlegroups.com> X-Original-NNTP-Posting-Host: w03duo.pnet.ch X-Original-Trace: 12 Nov 2007 08:57:45 +0200, w03duo.pnet.ch Xref: g2news1.google.com comp.lang.ada:18297 Date: 2007-11-12T08:57:10+01:00 List-Id: braver schrieb: > Tim Bray has a fantastic parallel programming challenge, Wide Finder, > running at full speed: > > http://www.tbray.org/ongoing/When/200x/2007/10/30/WF-Results > > It originated by trying parallel Erlang live up to regular Ruby. Now > the top contenders are JoCaml -- parallel OCaml, Python, and there're > many implementations in Erlang, Haskell, and even things like PHP and / > bin/sh. (This is the first place where I've heard "parallel gawk".) > > Given the target box is Sun with 8 cores, Ada would shine there is my > guess. Perhaps some pro here could beat JoCaml? First here is the original Ruby code: http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder So we know what to implement. Basicly: 1 Read File 1.1 Search for %r{GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/\d\d/[^ .]+) } 1.2 Count hits on found string using a map 2 Output result 2.1 sort map 2.2 output top 10 First improvement would be the use of Splitbool instead of regular expressions. And then reading and counting could be decoupled. Some implementation decouple reading the file and spitting into lines. First things First: Any Splitbool specialist which can turn the Ruby regex into splitbool? Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com