Golang vs Node for project

agolangf · · 379 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve recently moved from python to node and Im enjoying it however it doesn&#39;t support multithreading. I&#39;m working on a project that entails webscraping and automating using electron. I want to make a web app that can withstand hundreds of users without effecting the performance too much as speed is extremely important. Is Golang a better language for this compared to node?</p> <hr/>**评论:**<br/><br/>Muchoz: <pre><p>My brother is working on a web scraper of the dark web which is written in Go because of the performance. I myself am working on others stuff in Go and if you&#39;re looking for performance in backend development, then you&#39;re probably not gonna get the performance anywhere else. I&#39;m no Javascript fan so I would recommend anything over Javascript really. I also came from (and am still doing) Python development and Go&#39;s concurrency is unmatchable imo.</p></pre>afghanPower: <pre><p>I would argue Clojure&#39;s handling of concurrency is at least as good. (Not much of a surprise since it&#39;s heavily inspired by Go).</p></pre>mixedCase_: <pre><p>There are Go libraries for handling your usecase. Performance-wise and not-being-goddamned-Javascript-wise, Go does better than Node.</p></pre>cheesechoker: <pre><p>Node.js can be competitive if your app is basically waiting on network I/O most of the time, and performs minimal CPU-bound processing. The event loop + callback/promise style of programming can be tedious, but with some care, it should easily support hundreds of simultaneous users.</p> <p>On the other hand, if your app needs to perform any actual crunching of data, you&#39;ll need to deal with multiple servers or processes to stay responsive in Node. Managing these can be a pain, and Go quickly begins to look like a more natural choice.</p></pre>redditbanditking: <pre><p>Go will definitely be faster, but I would like to caution you a little bit that you do have to handle the concurrency yourself. You don&#39;t just simply get it by switching to Go. Concurrency programming requires mastery of its own, and if you are not used to it, it can get hairy pretty quick.</p></pre>rco8786: <pre><p>In this sub most folks will say Go. In the node sub most folks will say Node. Either will likely work just fine. </p></pre>iends: <pre><p>Both platforms can easily handle hundreds of users. Node is a bit quicker of a platform to develop on, but it costs you more in the long run in maintenance. If your team size is &gt; 3 I think Go clearly wins.</p> <p>fwiw, I&#39;ve found working with SQL DBs in Go unpleasant compared to scripting languages.</p> <p>Disclaimer: I lead a team of Node developers, but would like to transition to Go.</p></pre>jgillich: <pre><p>I&#39;d probably go with Node, it has many tools and frameworks for web automation. To my knowledge, Go is generally faster and easier to scale, but the difference is not that much.</p> <p>You can achieve &#34;multithreading&#34; in Node by running multiple processes, see the cluster module and process managers like pm2.</p></pre>: <pre><p>[deleted]</p></pre>devmach: <pre><p>I think the idea with node cluster module is not killing process after it&#39;s done but have N amount of child processes running all the time and they being handling operations. Therefore, forking happens only at the app start-up.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

379 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传