![]() |
Practical mod_perl / HTML Version / | ![]() |
||
![]() |
||||
![]() |
![]() |
|||
![]() |
![]() |
|||
![]() |
||||
|
|
||||
![]() |
![]() |
|||
![]() |
Chapter 13. TMTOWTDI: Convenience and Habit Versus Performance |
![]() |
||
![]() |
||||
![]() |
![]() |
![]() |
||
![]() |
||||
Apache::Registry PerlHandler Versus Custom PerlHandler
Apache::args Versus Apache::Request::param Versus CGI::param
Buffered Printing and Better print( ) Techniques
Interpolation, Concatenation, or List
Keeping a Small Memory Footprint
Object Methods Calls Versus Function Calls
Using the Perl stat( ) Call's Cached Results
time( ) System Call Versus $r->request_time
Printing Unmodified Files
Caching and Pre-Caching
Caching with Memoize
Comparing Runtime Performance of Perl and C
References
TMTOWTDI (sometimes pronounced "tim toady"), an acronym for "There's More Than One Way To Do It," is the main motto of Perl. In other words, you can reach the same goal (usually a working product) by coding in many different styles, using different modules and deploying the same modules in different ways.
However, when you come to the point where performance is the goal, you might have to learn what's efficient and what's not. This may mean that you will have to use an approach that you don't really like, that's less convenient, or that requires changing your coding habits.
This section is about performance trade-offs. For almost every comparison, we will provide the theoretical difference and then run benchmarks to support the theory. No matter how good the theory is, it's the numbers we get in practice that matter.
We also would like to mention that the code snippets used in the benchmarks are meant to demonstrate the points we are making and are intended to be as short and easy to understand as possible, rather than being real-world examples.
In the following benchmarks, unless stated differently, mod_perl is tested directly, and the following Apache configuration has been used:
MinSpareServers 10 MaxSpareServers 20 StartServers 10 MaxClients 20 MaxRequestsPerChild 10000
 
Continue to:
mod_perl, modperl, Apache, perl, cgi, html, mod_perl, e-commerce, scalability, free, open source, OSS, apache, squid, high availability, modperl, linux, unix, Web, www, mod_perl, webserver, admin, apache, book, webmaster, tools, modperl, guide, docs, documentation, help, mod_perl, perl, information, apache, script, errata, eric cholet, perl, apache, mod-perl, stas bekman, mod_perl, cool, perl, Apache, performance, speed, choice
![]() |
Other projects to check out: meta-religion.com is for those interested in Religious, Spiritual and Esoteric Phenomena. i-want-a-better.com is a community of people discussing what they would like to be improved in their lives and things they use and interact with. You may also want to find a healer in your area or read articles on variety of topics.