{"action":"created","issue":{"url":"https://api.github.com/repos/ry/deno/issues/162","repository_url":"https://api.github.com/repos/ry/deno","labels_url":"https://api.github.com/repos/ry/deno/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/ry/deno/issues/162/comments","events_url":"https://api.github.com/repos/ry/deno/issues/162/events","html_url":"https://github.com/ry/deno/issues/162","id":329880882,"node_id":"MDU6SXNzdWUzMjk4ODA4ODI=","number":162,"title":"What I hate about Node.js","user":{"login":"alexhultman","id":3397140,"node_id":"MDQ6VXNlcjMzOTcxNDA=","avatar_url":"https://avatars1.githubusercontent.com/u/3397140?v=4","gravatar_id":"","url":"https://api.github.com/users/alexhultman","html_url":"https://github.com/alexhultman","followers_url":"https://api.github.com/users/alexhultman/followers","following_url":"https://api.github.com/users/alexhultman/following{/other_user}","gists_url":"https://api.github.com/users/alexhultman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexhultman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexhultman/subscriptions","organizations_url":"https://api.github.com/users/alexhultman/orgs","repos_url":"https://api.github.com/users/alexhultman/repos","events_url":"https://api.github.com/users/alexhultman/events{/privacy}","received_events_url":"https://api.github.com/users/alexhultman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-06-06T14:00:28Z","updated_at":"2018-06-06T15:16:24Z","closed_at":null,"author_association":"NONE","body":"Hello there Ryan,\r\n\r\nI randomly came across your talk on what you regret in Node.js.\r\n\r\nI have a handful of opinions of where Node.js fails miserably, they are all performance related since Node.js is horribly slow at most tasks except for maybe a few corner cases where it manages to perform 1x the perf. of other servers. Mainly because it hits the Linux kernel max throughput.\r\n\r\nI've been working with (or should I say against) Node.js for 2 years doing perf. work and the most obvious flaws are listed here:\r\n\r\n1. You spent too much time on low level C-code and way too little time optimizing the V8 <-> C calls. Node.js does about 5-10x fewer HTTP req/sec for small responses than what it easily could pull off if you didn't jump back and forth between JS and C and JS and C all the time. There is a significant cost jumping the fence and Node.js wrappers around V8 adds more than 200% overhead to that.\r\n\r\n2. Everything in the node:: namespace is horrible. ArrayBuffer is extremely much faster than Buffer, V8 native function calls are extremely much faster than the node wrappers. I boosted my server throughput 100% by swapping from passing data from C to JS via node Buffer and to using ArrayBuffer. This shows how horribly miserable the perf. control is within Node.js.\r\n\r\n3. libuv is a miscarriage of a networking stack and fails to properly represent the underlying operating system. It requires tons and tons of memory and does not even have SSL support. This leads to Node.js having to implement SSL which only increases the complexity and the size of the pit which obviously is going to be fallen into. You can read more on libuv failures here: https://github.com/uNetworking/uSockets. Mainly libuv fails to recognize Linux is a reactor pattern operating system.\r\n\r\n4. Native addons never caught on, and instead people started to write everything as JavaScript modules and NPM exploded with the most rotten, horrible code man kind ever saw. Socket.IO, Express.js and other such \"core\" modules became the standard and nobodoy cared to ever check just how intense the performance loss was. Socket.IO alone has a 200x (not 200%) performance loss over what you easily can achieve with native addons. Node-gyp is a disgrace to humanity and completely pointless. Writing core modules in JS is the worst possible idea -> JS is a script and should only be used to write business logic, not data base drivers and realtime libraries, etc. You can read more about the failure of NPM modules here: https://github.com/alexhultman/The-Node.js-performance-palette\r\n\r\n5. I will post this in next comment, I just wrote these points in a hurry. They are the most significant ones though.\r\n\r\n6. You need to benchmark! Benchmark everything all the time. Node.js has never been benchmarked against anything modern. People say that Apache is C and Node.js is faster than Apache thus JavaScript is faster than C. Apache was written in 1993 for a completely different era of networking. Benchmark against any modern C server and you'l find easily 5-10x the performance difference for smaller sends. Heck modern C servers outperform Node.js 4x even when using SSL and Node.js only doing TCP."},"comment":{"url":"https://api.github.com/repos/ry/deno/issues/comments/395106338","html_url":"https://github.com/ry/deno/issues/162#issuecomment-395106338","issue_url":"https://api.github.com/repos/ry/deno/issues/162","id":395106338,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTEwNjMzOA==","user":{"login":"alexhultman","id":3397140,"node_id":"MDQ6VXNlcjMzOTcxNDA=","avatar_url":"https://avatars1.githubusercontent.com/u/3397140?v=4","gravatar_id":"","url":"https://api.github.com/users/alexhultman","html_url":"https://github.com/alexhultman","followers_url":"https://api.github.com/users/alexhultman/followers","following_url":"https://api.github.com/users/alexhultman/following{/other_user}","gists_url":"https://api.github.com/users/alexhultman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexhultman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexhultman/subscriptions","organizations_url":"https://api.github.com/users/alexhultman/orgs","repos_url":"https://api.github.com/users/alexhultman/repos","events_url":"https://api.github.com/users/alexhultman/events{/privacy}","received_events_url":"https://api.github.com/users/alexhultman/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T15:16:24Z","updated_at":"2018-06-06T15:16:24Z","author_association":"NONE","body":"@dsamarin :clap: :sparkles: :tada:"}}
{"actor":{"display_login":"alexhultman"}}