2 ms·
The article uses two examples to demonstrate that v8 is in fact fast. However, when using python or ruby to create a web server, the server will actually run in
by billconan 15y ago
The article uses two examples to demonstrate that v8 is in fact fast. However, when using python or ruby to create a web server, the server will actually run in parallel (multiple threads), therefore, the average waiting time could be less than the node.js version.
- billconan 15y agosuppose, for example, we have two people connecting to the server at the same time. if it is the node.js server, one person waited for 5 seconds, the other one waited for 10 seconds, the average waiting time is (5+10) / 2 = 7.5 assume that the python server is less efficient, which takes 7 seconds to finish the job. but it runs in parallel. so both two people waited 7 seconds. therefore, on average, the python server is in fact, faster
- billconan 15y agoi am not a node.js expert. one thing i am wondering is that, modern computers have more than just one core. how node.js utilizes these multiple cores?
- ricardobeat 15y agoBy starting multiple processes. See cluster (https://github.com/LearnBoost/cluster https://github.com/LearnBoost/cluster), fugue (https://github.com/pgte/fugue https://github.com/pgte/fugue), multi-node (https://github.com/kriszyp/multi-node https://github.com/kriszyp/multi-node)
- aliem 15y agoThis is true for Python, Ruby, PHP. (I can't see ted's issues with node other than misunderstanding of the framework's runtime)