7 ms·
The Go vs JavaScript lineup is quite stunning. Go destroys Node.js in memory usage and performance on every test except regex-redux (edge case?). http://benchm
by nodesocket 9y ago
The Go vs JavaScript lineup is quite stunning. Go destroys Node.js in memory usage and performance on every test except regex-redux (edge case?).
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=node http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
- Terribledactyl 9y ago>regex-redux (edge case?) It looks like the JS version is using the built in runtime's regex engine. I don't know exactly why (maybe differences or missing features in go's regex) but the go version is actually using the c FFI to call pcre.h, and without profiling it I'd guess a huge hit is that alone.
- weberc2 9y agoI think Go's regex lib is native Go, but simply naive. In any case, this particular benchmark isn't useful unless your application is regex as a service.
- igouy 9y ago> I don't know exactly why … and without profiling it I'd guess a huge hit is that alone. Don't guess. Look at the measurements. Look at the source code. That Go PCRE program is faster than -- http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexredux&lang=go&id=1 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... Maybe faster still to use some of the techniques from this other Go PCRE program -- http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexredux&lang=go&id=9 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...
- Safety1stClyde 9y ago> The Go vs JavaScript lineup is quite stunning. Go destroys Node.js in memory usage and performance on every test except regex-redux (edge case?). Why would it be stunning that a programming language compiled to assembler can beat a broken-by-design interpreted language which doesn't even have integers or arrays? The stunning part is that the people behind node.js have managed to get that much performance.
- alayne 9y agoThat's not a very fair or accurate description. JavaScript implementations use a JIT which is different than what people usually mean by interpreted. Types can be inferred without explicit type declarations. JavaScript has Array and integer semantics can also be inferred.
- weberc2 9y agoAlso JS has received many times the investment of Go.
- nodesocket 9y agoUmmmm, that's a somewhat harsh and arrogant reply. I actually enjoy coding in Node.js myself. I just wasn't aware how much faster go is (according to these benchmarks of course).
- Safety1stClyde 9y agoI program in Go and JavaScript, but don't enjoy it. I assure you that JavaScript is an interpreted language, and it does not have arrays or integers. This is not a harsh statement but a factual one.
- baron816 9y agoThere's plenty to not like about JS, but being interpreted and not having integers or arrays is not high on its negatives list. The little bit of good far outweighs the whole lot of bad. If you don't enjoy JS, it's because you haven't taken the time to learn what's great about it and have gotten hung up on the stupid things other people do with it or you're copying their mistakes.
- innocentoldguy 9y agoThat last paragraph is a logical fallacy, because it posits that one's distaste for JavaScript could only come via ignorance. I will offer my own anecdotal experience to refute that assertion. I've been forced to use JavaScript since the 1990s, and have done significant amounts of work in Node for several companies. I dislike Node and JavaScript because JavaScript has a weak standard library, ugly syntax, is slow, is a pain to scale, and a pain to write complex code with. I will absolutely give credit to the Node community for improving JavaScript, in both speed and syntax, and admit that JavaScript is better now than it ever has been; however, so are most popular languages. Personally, I've removed JavaScript from my resume, and turn down jobs that use it. If I have to use it for some reason, I can, but right now, I typically avoid it altogether by using Elm, and real server-side languages on the backend. I can't speak for anyone else, but I know JavaScript and still don't like it.