Perl - Comparative Performance

Comparative Performance

The Computer Language Benchmarks Game, a project hosted by Alioth, compares the performance of implementations of typical programming problems in several programming languages. The submitted Perl implementations typically perform toward the high end of the memory-usage spectrum and give varied speed results. Perl's performance in the benchmarks game is typical for interpreted languages.

Large Perl programs start more slowly than similar programs in compiled languages because perl has to compile the source every time it runs. In a talk at the YAPC::Europe 2005 conference and subsequent article "A Timely Start", Jean-Louis Leroy found that his Perl programs took much longer to run than he expected because the perl interpreter spent much of the time finding modules because of his over-large include path. Unlike Java, Python, and Ruby, Perl has only experimental support for pre-compiling. Therefore Perl programs pay this overhead penalty on every execution. The run phase of typical programs is long enough that amortized startup time is not substantial, but benchmarks that measure very short execution times are likely to be skewed due to this overhead.

A number of tools have been introduced to improve this situation. The first such tool was Apache's mod_perl, which sought to address one of the most-common reasons that small Perl programs were invoked rapidly: CGI Web development. ActivePerl, via Microsoft ISAPI, provides similar performance improvements.

Once Perl code is compiled, there is additional overhead during the execution phase that typically isn't present for programs written in compiled languages such as C or C++. Examples of such overhead include bytecode interpretation, reference-counting memory management, and dynamic type-checking.

Read more about this topic:  Perl

Famous quotes containing the words comparative and/or performance:

    The utmost familiarity with dead streams, or with the ocean, would not prepare a man for this peculiar navigation; and the most skillful boatman anywhere else would here be obliged to take out his boat and carry round a hundred times, still with great risk, as well as delay, where the practiced batteau-man poles up with comparative ease and safety.
    Henry David Thoreau (1817–1862)

    O world, world! thus is the poor agent despised. O traitors and bawds, how earnestly are you set a-work, and how ill requited! Why should our endeavour be so loved, and the performance so loathed?
    William Shakespeare (1564–1616)