in reply to Doing perl efficiently

I'll second the recommendation for Devel::NYTProf. It is a fantastic profiler! That said, your efficiency and that of those that will have to read or support your code is at least as important as the efficiency of the code itself. Go first for correctness and clarity. Worry about code efficiency only if there is a problem. Moore's law will make your code run twice as fast in a few years, but it won't help at all with correctness or clarity.

Replies are listed 'Best First'.
Re^2: Doing perl efficiently
by SuicideJunkie (Vicar) on May 18, 2011 at 14:45 UTC

    If only... Unless your code can make use of multiple cores, its not any faster than on a 2004ish machine :(.

    We ought to be up near 15Ghz by now, and where's my flying car?

      My fairly new machine is much faster than my 2004 rig, even running on one thread. More megaHz, more pipelining, 64-bit OS, and faster RAM. Not to mention faster HD, being a SSD, and more RAM so less swapping in the first place.

      Gotta be careful though. My first attempt melted down when I ran Prime95 at 4.2GHz. Lousy "open-box" deal... but that's why we test, right?

      I know per-thread it's faster than stuff put together in 2007 and 2008, which is my direct comparison. And that was a lot faster than what came before it.