How naive it's to believe node.js good for IO but bad for Computation?
2014-06-30 04:49
471 查看
The single process and asynchronous callback of node.js makes a lot of web developers who only know script programing cry. These developers argued, complained then labeled node.js not suitable for computation. How naive they are!
Since none of interpreted languages(also those languages running on VM, such as C# and Java) are not fast enough to perform complex computation, the assert about node.js is good for io but bad for computation is completely wrong. The who expecting the computation
function should write their owns addons in C/C++, just like they did as same as JNI and COM. So, the saying that nodejs has great io but poor computation is a pseudo-proposition.
wAnother popular complain about computation blocking services means the developers don't understand the essential core of Node.js' asynchronous model and performance going first . They still stay in the Stone Age of synchronous programming because their
less mature brain can't write asynchronous code. They think high-performance programming is just multi-thread and unfortunately node.js runs with single progress. Poor script kids(who's only know cording in script languages)! They must not have written any
extension of native code, neither PHP nor Ruby, Java and C#. They probably don't know aio and iocp.
Here I won't review the basis concept of computer science. I will provide a design that can extend the node.js computing capability to make it support graphics processing, video decode/encode/playback and even face recognition.
The basic concept is treating the CPU cores as same as IO resources, with the help of multi-thread or aio library which have been well implemented by boost and stl. Using asynchronous callback to return processing states and result, we'll break the single
process barrier of node.js. By dispatching computation resources like file io or database query, node.js will act as a computing center very well.
I couldn't talk about the details any more because it's been used in my project. I think anyone who is better than script kids can implement it by himself. If you don't please learn more.
The design sounds great. But after all, you should know how to write addons with C/C++, and multithreaded/aio programming. Most script kids will sucks.
Let them cry!
;-)
Since none of interpreted languages(also those languages running on VM, such as C# and Java) are not fast enough to perform complex computation, the assert about node.js is good for io but bad for computation is completely wrong. The who expecting the computation
function should write their owns addons in C/C++, just like they did as same as JNI and COM. So, the saying that nodejs has great io but poor computation is a pseudo-proposition.
wAnother popular complain about computation blocking services means the developers don't understand the essential core of Node.js' asynchronous model and performance going first . They still stay in the Stone Age of synchronous programming because their
less mature brain can't write asynchronous code. They think high-performance programming is just multi-thread and unfortunately node.js runs with single progress. Poor script kids(who's only know cording in script languages)! They must not have written any
extension of native code, neither PHP nor Ruby, Java and C#. They probably don't know aio and iocp.
Here I won't review the basis concept of computer science. I will provide a design that can extend the node.js computing capability to make it support graphics processing, video decode/encode/playback and even face recognition.
The basic concept is treating the CPU cores as same as IO resources, with the help of multi-thread or aio library which have been well implemented by boost and stl. Using asynchronous callback to return processing states and result, we'll break the single
process barrier of node.js. By dispatching computation resources like file io or database query, node.js will act as a computing center very well.
I couldn't talk about the details any more because it's been used in my project. I think anyone who is better than script kids can implement it by himself. If you don't please learn more.
The design sounds great. But after all, you should know how to write addons with C/C++, and multithreaded/aio programming. Most script kids will sucks.
Let them cry!
;-)
相关文章推荐
- Incorrect key file for table '.\user\user.MYI'; try to repair it
- java.io.IOException: You have to specify '-keep' options for the shrinking step.
- MySQL坏表?异常:Incorrect key file for table './xx_db/xx_table.MYI'; try to repair it
- Failed to allocate nodeid for API at 192.168.55.9. Returned eror: 'No free node id found for mysqld
- LXC+PBS+集群调度 msg: 'Bad UID for job execution MSG=connection to mom timed out'
- ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_1d87_0.MYI'; try to repair it
- /usr/sbin/mysqld: Incorrect key file for table './test/user.MYI'; try to repair it 解决
- hadoop错误java.io.IOException Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being available to try
- Ignoring unused library classes...java.io.IOException: You have to specify '-keep' options for the s
- Unable to acquire a device for port 'COM5'. It appears to be in use.解决办法
- [Javascript] A function works like 'print_r()' in PHP to print out the details of an object for JS debugging
- java.io.IOException: Failed to replace a bad datanode on the existing pipeline due to no more good
- Incorrect key file for table '/tmp/#sql_15cc_14.MYI'; try to repair it
- MySQL: [ERROR] /usr/sbin/mysqld: Incorrect key file for table './xxx/xxxx.MYI'; try to repair it
- no rule to process file 'xxx/.../jquery.js' of type sourcecode.javascript for architecture i386
- Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key
- Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'XXXException'.
- Error 3724:Cannot drop the table 'object_name' because it is being used for replication.
- 【错误解决】Unable to find script library 'WebUIValidation.js'
- "WorldClient was expected to be running but wasn't;"解决方法