Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Perl
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Performance == [[The Computer Language Benchmarks Game]] compares the performance of implementations of typical programming problems in several programming languages.<ref>{{cite web |url=http://alioth.debian.org/projects/benchmarksgame/ |title=Alioth: The Computer Language Benchmarks Game: Project Info |access-date=2011-01-13 |publisher=[[Alioth]] |archive-url=https://web.archive.org/web/20130325192723/https://alioth.debian.org/projects/benchmarksgame/ |archive-date=March 25, 2013 |url-status=dead |df=mdy-all}}</ref> 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.<ref>{{cite web |url=http://benchmarksgame.alioth.debian.org/u32/which-programs-are-fastest.php?v8=on&lua=on&jruby=on&php=on&python3=on&yarv=on&perl=on |archive-url=https://web.archive.org/web/20130517145336/http://benchmarksgame.alioth.debian.org/u32/which-programs-are-fastest.php?v8=on&lua=on&jruby=on&php=on&python3=on&yarv=on&perl=on |url-status=dead |archive-date=2013-05-17 |title=Which programs are fastest? |access-date=2011-01-13 |work=Computer Language Benchmarks Game |publisher=[[Alioth]]}}</ref> 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 [[Yet Another Perl Conference|YAPC::Europe 2005]] conference and subsequent article "A Timely Start", Jean-Louis Leroy found that his Perl programs took much longer to run than expected because the perl interpreter spent significant time finding modules within his over-large include path.<ref>{{cite web |url=http://www.perl.com/pub/a/2005/12/21/a_timely_start.html |title=A Timely Start |last1=Leroy |first1=Jean-Louis |date=2005-12-01 |publisher=O'Reilly |access-date=May 22, 2006 |archive-date=June 13, 2006 |archive-url=https://web.archive.org/web/20060613025623/http://www.perl.com/pub/a/2005/12/21/a_timely_start.html |url-status=live}}</ref> Unlike Java, Python, and Ruby, Perl has only experimental support for pre-compiling.<ref>{{cite web |url=https://metacpan.org/module/NWCLARK/perl-5.8.8/ext/B/B/Bytecode.pm#KNOWN-BUGS |title=B::Bytecode Perl compiler's bytecode backend |author1=Beattie, Malcolm |author2=Enache Adrian |name-list-style=amp |year=2003 |publisher=[[CPAN]] |access-date=September 16, 2013 |archive-date=March 30, 2021 |archive-url=https://web.archive.org/web/20210330011632/https://metacpan.org/pod/release/NWCLARK/perl-5.8.8/ext/B/B/Bytecode.pm#KNOWN-BUGS |url-status=dead}}</ref> 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.<ref>{{Cite book|last1=Schwartz|first1=Randal|url=https://books.google.com/books?id=va1PSgaO4xIC&q=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.|title=Learning Perl|last2=foy|first2=brian|last3=Phoenix|first3=Tom|date=2011-06-23|publisher="O'Reilly Media, Inc."|isbn=978-1-4493-0358-7|language=en}}</ref> 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: [[Common Gateway Interface|CGI]] [[World Wide Web|Web]] development. [[ActiveState|ActivePerl]], via Microsoft [[ISAPI]], provides similar performance improvements.<ref>{{Cite book|last1=Stein|first1=Lincoln|url=https://books.google.com/books?id=qyzTI_eAeHUC&q=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.|title=Writing Apache Modules with Perl and C: The Apache API and Mod_perl|last2=MacEachern|first2=Doug|date=1999|publisher="O'Reilly Media, Inc."|isbn=978-1-56592-567-0|language=en}}</ref> 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.<ref>{{Cite book|last1=Bekman|first1=Stas|url=https://books.google.com/books?id=UDabAgAAQBAJ&q=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.|title=Practical Mod_perl|last2=Cholet|first2=Eric|date=2003|publisher="O'Reilly Media, Inc."|isbn=978-0-596-00227-5|language=en}}</ref> The most critical routines can be written in other languages (such as [[C (programming language)|C]]), which can be connected to Perl via simple Inline modules or the more complex, but flexible, [[XS (Perl)|XS]] mechanism.<ref>{{cite web |url=https://metacpan.org/module/Inline |title=Inline - metacpan.org |access-date=2011-01-26 |last=Ingerson |first=Brian |publisher=[[CPAN]] |url-status=dead |archive-url=https://web.archive.org/web/20130613163723/https://metacpan.org/module/Inline |archive-date=June 13, 2013}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)