[Melbourne-pm] Still performing well..

Daniel Pittman daniel at rimspace.net
Tue May 18 19:26:58 PDT 2010

Toby Corkindale <toby.corkindale at strategicdata.com.au> writes:
> On 19/05/10 12:01, Sam Watkins wrote:
>> On Tue, May 18, 2010 at 04:52:40PM +1000, Daniel Pittman wrote:
>>> Toby Corkindale<toby.corkindale at strategicdata.com.au>  writes:
>>>> On 18/05/10 15:28, Daniel Pittman wrote:
>>>>> Toby Corkindale<toby.corkindale at strategicdata.com.au>   writes:


>> I have a C (actually brace) program which loads and indexes a 22,000 line 630KB
>> file, a Tagalog - English dictionary, in 0.020 seconds on my wimpy little VPS.
>> It's not TSV it's records of key: value pairs (like mail headers) but if
>> anything it's harder to parse than CSV because I have to look up the keys.
>> Almost half of the 0.020 seconds is the time to fork and exec!
>> ("hello world" takes ~ 0.008s) and it's not a very efficent implementation.
>> Even in pure perl I can do something similar in under 0.1 seconds.  So I'm
>> guessing your CSV file is a lot bigger than that?
> Would you like to submit a brace version of my simplistic benchmark? Then we
> can compare apples with apples.
> It'll probably eat the others alive; so would a C implementation, I'm guessing
> - but then again, maybe not - the Scala version is looking pretty snappy
> now.

Interestingly, it looks like the JVM (and LLVM) is sometimes starting to live
up to the initial promise of JIT-style development: that your optimizing
compiler can do *better* than static compilation, because it has the real
world to watch.[1]

I don't know it will do better, but I suspect that as the files grow larger
the Scala / JVM version will manage to mostly maintain parity with the C (or
Brace) version of the code.[2]

On a Perl related note, I was interested to see that someone is looking to
wire the LLVM engine to the Perl5 VM.  Initial results suggested little gain
when Perl itself was compiled with GCC and the Perl bytecodes emitted to LLVM.

Theoretically, though, if Perl was LLVM-compiled and retained the IL version
you could see LLVM machine-compile with the C-level functions inlined.


[1]  See also the fashion for trace-compilation of JavaScript.

[2]  ...unless the C version cheats and skips all the memory management
     overhead, by not freeing anything 'til the end of the process or
     something exciting like that. :)

✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

More information about the Melbourne-pm mailing list