4 ms·
> write high performance JavaScript Does anyone with high performance requirements writes JS? Isn't that setting yourself up for failure on the first step?
by romanovcode 9y ago
> write high performance JavaScript
Does anyone with high performance requirements writes JS? Isn't that setting yourself up for failure on the first step?
- jaegerpicker 9y agoDepends on your application and style of development. In my experience Node.js is almost always much faster than Ruby/Python and in some cases it's much faster than Java Spring type apps for certain types of network applications (mainly io bound web apps serving a lot of small requests, the event loop async nature of node really shines there). It's not C/C++ or pure Java or Go type of speed but for a lot of web application development? Node.js is great performant choice.
- merpnderp 9y ago"Does anyone with high performance requirements writes [JS, Python, PHP, Ruby, Perl, Tcl, Shell, Scheme, Lua]? Isn't that setting yourself up for failure on the first step?" And yet there are a plethora of cases where all of those languages have been used with high performance requirements.
- romanovcode 9y agoYeah, that's my point. I'm not hating on JS or dynamic languages but to me it seems a stupid decision to go with that kind of language if you really need performance.
- coldtea 9y agoThat's assuming you ONLY need performance. How about you needing performance AND web compatibility?
- Cthulhu_ 9y agoNot when JS is fast enough, and if you want standards-compliant web games (like webgl), it's your only option. There's a big number of startups that used Node for their back-end, if it becomes faster without them having to rewrite their codebase, that's a win too.
- skibz 9y ago> Does anyone with high performance requirements writes JS? It's possible to call into C from Node. So there's nothing stopping you from implementing performance-critical parts of a system with native code, and then invoking it from JavaScript.
- coldtea 9y agoNothing except of it being messy and you ending up with two problems (to paraphrase JWZ).
- coldtea 9y ago>Does anyone with high performance requirements writes JS? Isn't that setting yourself up for failure on the first step? You assume that "high performance" is the only requirement, so that it dictates everything. People also have other requirements like "it has to run on a browser/on the web" etc AND high performance. It's not like HPC people suddenly rush to use JS. But there are people targeting the web/node etc that DO want as high performance as they can get away with (e.g. web games).
- SOLAR_FIELDS 9y agoYes, there are use cases for high performance JS. We have JS that we use client side that we also use server side for Hadoop processing of data. So we didn't want to rewrite and maintain this large codebase in both Scala/Python and JS, so we ran Node on Hadoop. No, it really isn't setting yourself up for failure if you do it correctly. Node really is quite fast; for our use case it rivaled Java 8 runtime in MR CPU time, the only downside is it had double the memory footprint. With enough hardware, memory is not too much of an issue.
- qaq 9y agoWalmart, PayPal etc. are doing fine running large scale apps on node.
- romanovcode 9y agoScalability is not performance.
- westoque 9y agoIt depends on the context of "high performance". For example, would a 400ms load time be considered "high performance"? I always say use the best tool for the job. And this usually means getting the requirements then laying out the solutions and picking the best solution out of the bunch.
- akmittal 9y ago>Does anyone with high performance requirements writes JS? It bothers me that people still think JavaScript is slow. I think JavaScript(engines) is the only languages which is getting significant performance improvement on monthly basis since V8 was introduced. It is the abstraction people in JS/Frontend world people are used to, make it seem slow.