in reply to Re^2: Perl slower than java
in thread Perl slower than java

performance-aware algorithm design

I fulle agree, however sometimes there is not a lot you can do. Or sometimes the cost is less important/irrelevant, only speed matters. To give an example, I'm working on over-constrained CSP's and the algorithms are al at least NPC. Speeds is very important. We will even settle for sub-optimal solutions if we can speed things up. This is exlactly the reason why I've been looking into genetic algorithms.

If you can improve the performance of a C-program by a factor 60 by rewriting it in Perl I would argue it was a poor implementation in C in the first place. I'm a big fan of Perl but I'm not religious when it comes to programming, when I need speed there are normally better options available.

Cheers

Harry

Replies are listed 'Best First'.
Re^4: Perl slower than java
by anonymized user 468275 (Curate) on Dec 09, 2010 at 14:32 UTC
    The problem wasn't that it was a bad implementation in C -- it just wasn't a system programming implementation in C with calls to system services everywhere. To take a very common example, a C system programmer will use system library calls to process a bunch of files by wildcard, whereas a C application programmer would probably use ksh for that part of the solution. A Perl programmer will also use system calls, but transparently :)

    One world, one people