Practical mod_perl-CHAPTER 13:TMTOWTDI: Convenience and Habit Versus Performance

Tham khảo tài liệu 'practical mod_perl-chapter 13:tmtowtdi: convenience and habit versus performance', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Page 453 Thursday November 18 2004 12 42 PM CHAPTER 13 TMTOWTDI Convenience and Habit Versus Performance 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 Apache Registry PerlHandler Versus Custom PerlHandler At some point you have to decide whether to use Apache Registry or similar handlers and stick to writing scripts only for content generation or to write pure Perl handlers. 453 Page 454 Thursday November 18 2004 12 42 PM Apache Registry maps a request to a file and generates a package and the handler subroutine to run the code contained in that file. If you use a mod_perl handler instead of Apache Registry you have a direct mapping from request to subroutine without the steps in between. The steps that Apache Registry must go through .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
27    174    2    03-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.