Interpreted vs. Compiled Languages for Web Sites (PHP, ASP, Perl, Python, etc.)

前端 未结 7 805
名媛妹妹
名媛妹妹 2021-02-09 10:04

I build database-driven web sites. Previously I have used Perl or PHP with MySQL.

Now I am starting a big new project, and I want to do it in the way that will result in

7条回答
  •  执笔经年
    2021-02-09 10:33

    Tomcat is a common way to use compiled languages to deploy webpages, but before you go too far, seriously consider what your speed bottlenecks will be. There are a few main sources of slowdown in web applications:

    1. Network latencies
    2. Static media, especially images
    3. Database queries
    4. Server-side processing code
    5. Client-side processing code

    1 and 5 don't really have much to do with this question.

    2 will be relevant if you have many images that vary from page to page. If that's the case, client browsers won't do such a good job caching, and each page-load will take some time. In this case, it is very likely that your server-side language won't be noticed, because the overhead from static media will dominate.

    3 is likely to be a bigger factor than 4 for a lot of applications. If you have very little data, but you do a whole lot of processing, then 4 may dominate, but otherwise, 3 will dominate even if you're using an interpreted language.

    People can ask "Why optimize php?" because the 2 and 3 are often more important anyway. Often, a good database caching framework is going to be a better (and easier) optimization.

提交回复
热议问题