0. Reply content: any concept of "XXX language is too slow" is partial.
There are many types of applications, such as CPU bound, I/O bound, and Memory bound. If your program belongs to I/O bound, even if you change the entire program to a manually optimized C, the speed will not be substantially improved.
For Dropbox, its business logic is not complex, and the performance bottleneck is obviously in I/O. in addition to the SHA statement that I estimate when determining the weight, CPython has a major advantage in that it is easy to use the C Writing module. It is not too late to use C to write the code after finding the hot spot. "Premature optimization is the root of all edevil ."
In this case, the use of a language with poor performance but easy to read and write, perfect ecosystem, cross-platform, and fast iteration is just a matter of course.
What's more, the author of Guido and Python has been dug by Dropbox.
Python is indeed several orders of magnitude slower than compiled languages, but it is only related to applications restricted by CPU.
Dropbox is mainly subject to disk and network constraints. Therefore, the use of compiled languages does not significantly speed up Dropbox, because most of the time is spent on reading and writing data rather than computing.
The advantage of interpreted language is the development speed, which is why most websites use interpreted language for development. Programmers benefit from these advantages when these disadvantages are marginalized.
References:
William Ting's answer to Python (programming language): How can some really large services (like Dropbox) afford to use Python as a primary language, if it's one to two orders of magn1_slower than other, compiled ages?
Large services use Python as the main language. I know Dropbox, YouTube, Quora, and zhihu. In fact, it doesn't make much sense to analyze why Dropbox and YouTube use Python. Because Dropbox file synchronization and YouTube's core online video functions, I believe they are not implemented using Python.
Instead, it is more accurate to analyze why Quora and Quora use Python as the main language. Why does Quora use Python? I reference Adam d'angelo, founder of Quora.
And Charlie Cheever
The appearance Statement on Quora tells us why Python is used.
Adam mentioned in his answer that he first ruled out PHP after leaving Facebook to start Quora, because as a CTO before Facebook, he knew the pain brought by PHP; he also considered C #, Java, and even niche Scala, OCaml, and Haskell. Excluding C #, I don't want to be limited by Microsoft's protocol stack. Java requires a longer development cycle, at the same time, it is difficult to find skilled users. The reason for choosing Python is actually very simple:
Adam and another founder, Charlie, are familiar with Python!
From the usage of the following years, Adam is very glad to have chosen his own choice: All employees are very happy to use Python, no matter what the previous major language is; Tornado
With the launch of other frameworks, real-time services such as updates have a good place; PyPy
The Python performance may be greatly improved in the near future. Before this ideal implementation, Quora's performance-sensitive back-end code was written in C ++. Charlie also added that good frameworks such as Django and Pylons have benefited a lot. The data structures of Python and Javascript are very harmonious, as well as excellent third-party libraries such as email service and task queue.
Reference Source:
Quora Infrastructure: Why did Quora choose Python for its development?
I remember a saying like this:
The amount of water in a bucket does not depend on the highest block on the bucket wall, but on the shortest block on the bucket wall.
There is another saying:
The bearing capacity of an iron chain is determined by its weakest ring.
By the way, there is another figure, which I think is the most appropriate:
According to the answers given above, the subject should understand that large systems are rarely written in a single language .. Each language has its own characteristics and applicable environment.
Enterprises will select different languages for different components based on the specific use environment (IO intensive or computing intensive, development efficiency, etc.
Compile-type languages are used for areas that require high efficiency but few changes. For components with extremely high development efficiency that need to be added to new functions in three days, the "time cost" required for launching is much more valuable than the "Hardware investment" required to increase the speed.
The main environment in which explanatory languages are used is an economic act of "Changing (developing) Time With (hardware footprint) Space .. This logic is relatively simple and requires a large number of concurrent network applications. The performance of the language itself is not significantly affected. More bottlenecks lie in IO performance, therefore, the differences between different languages are not very large. Therefore, rapid development and iteration are used.
A Fast deployment language is more suitable for development efficiency and overall cost than a language that pursues performance like C. The key is that the IO speed is slow, so python is not slow. The algorithm used by the Dropbox client uses c ext, and even its UI library wxwidget is a Python shell, the speed bottleneck is the C code, so it's okay.
As for the server side, it is not clear about the Dropbox situation. For example, Quora has been fully switched to Cython to handle a larger load. I think the Dropbox server side cannot be implemented in Python alone. In the early stage, we started to see who is more agile. We once saw several blog posts by dropbox developers. The main reason for their adoption of python is that it can be relatively simple to implement cross-platform, and the development speed is fast, so as to achieve the goal of fast online. You can use Google to search for the dropbox technology stack and find my blog post.