undefinedfix
Sign in

About website development

oocri edited in Sat, 09 Apr 2022

Well, the problem is that I've learned Python before, but now I need to develop a medium-sized website. Many people on the Internet say that Python is too slow. How does Python web speed compare with PHP? Should we choose PHP for development or Python flash / Django? Seek the boss to point out the way QAQ

5 Replies
jsibs
commented on Sat, 09 Apr 2022

It's a way of thinking to talk a little nonsense

What you mentioned is a medium-sized website. That is to say, it can't be built in three or five days, and it may take dozens of days. Your problems are also reflected. It seems that you don't mind the time to learn PHP (should be to learn? Otherwise, you can learn PHP directly or Python). Similarly, you didn't mention your programming experience. I also speculate that according to the problems, You don't have much programming experience

This is to show my first worry. Developing a website is not a simple thing, and writing code is only the simplest part. As other respondents said, this should not be considered at this stage. What you should first consider is how to do the website. Of course, do you want to step left or right first? If you have no experience in web development, You can only learn the language first, and there is no way

Now let's talk about the speed. Python is really a bit slow. If you develop a website for the first time, I suggest you use Django, which can help you fully understand web development. You don't need to use flash to "originally this plug-in has realized this function", and you don't need to use tornado to appear "what am I doing". You just need to configure the route, write the logic, and prepare HTML, A lot of trivia are done by the framework for you

So how slow is Django?

To tell you the truth, it's not fast, but it's not right to say it's slow. Django is slow in concurrency. The entry-level cloud server can only handle hundreds of requests per second, and the design is not good, even less than 100 requests. 100 requests per second is more than 8 million a day. Of course, if the peak value is 100, there will be hundreds of thousands of visits every day. So generally speaking, concurrency is not a bottleneck, Can arrive at the website of 10 already beautiful Zizi

The speed of a single request can't exceed 1 second. The bottleneck is usually in the database. Requests that don't involve database operation are basically at 100 ms level. When it comes to the database, they usually don't exceed 500 ms. it's really boring. Compared with any other language, it's not too bad

Many people say that Python is slow. It's really slow. It's the difference between 144hz and 240Hz. Do you think there is a difference between the two? Of course, but most people still enjoy watching 60Hz. It's meaningless to discuss the difference between 144hz and 240Hz

My idea is that Python is OK, but considering more external factors, python will lose its status bit by bit. For example, for career development, web development Python can be considered as one of the worst choices, far less than Java, PHP, C + +, golang and other languages. When we recruit web developers, we always pay more attention to the understanding of the development itself, The mastery of tools is secondary. No matter how slow the code is, it's better to write it wrong

vtieb
commented on Sat, 09 Apr 2022

You can use what you know. Whether it is suitable or not is not a question you can consider at this stage. (you can't even do it. Why think about how to do it better)

user618424
commented on Sun, 10 Apr 2022

This question... PHP and python can meet your needs. Of course, you should use your most familiar language to do this. And the performance gap is not too big, not too will become the bottleneck of your website. Even if performance problems occur later, there are many ways to solve them.

obidano
commented on Sun, 10 Apr 2022

I personally prefer python, and PHP is not much faster than python. It is estimated that with the same logic, the difference between py and PHP is only a few hundred milliseconds, which is hard for customers to feel. If the real-time requirements are high, do not use the interpreted language, Java is the first choice

Vanessa
commented on Sun, 10 Apr 2022

PHP is the best language in the world

lock This question has been locked and the reply function has been disabled.