3 ms·
Not as a slight to Javascript, but simply because it is an interpreted language like Ruby - though you're right that benchmarks show a large performance gap. (J
by nemild 10y ago
Not as a slight to Javascript, but simply because it is an interpreted language like Ruby - though you're right that benchmarks show a large performance gap. (Javascript has significantly more investment in it, which is partially why it's such a performant language for an interpreted language)
Compare Javascript to many compiled languages, and it's still much slower with a heavier memory footprint (for heavy computation especially at internet scale or for realtime needs like graphics, you'll want to at least consider compiled languages).
But my original point is that performance shouldn't be the primary characteristic you measure a language or framework on, unless it is absolutely critical for your needs and you're fine with the other disadvantages that might bring.
- brlewis 10y ago"Interpreted language" is an imprecise term. A language is a language whether implemented in a compiler, an interpreter, or a REPL that includes a compile step. JavaScript is faster than Go in some benchmarks, and slower in others. In benchmarks where it's much slower, the reason isn't that JavaScript interpreters exist. The reason is design decisions in the JavaScript language that make optimization difficult. http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=v8&lang2=go http://benchmarksgame.alioth.debian.org/u64/compare.php?lang... Someone familiar with the V8 compiler might correct me, but I suspect that the binary tree program is slowed by JavaScript object-property access always being a dictionary lookup. I suspect that fasta and reverse-complement are slowed by JavaScript's one-type numeric tower ... everything's a float.
- pcwalton 10y agoJavaScript property lookup hasn't been forced into hash table access for probably a decade now.
- igouy 10y ago> … I suspect that the binary tree program is slowed by … I suspect that fasta and reverse-complement are slowed by … Maybe it's the way the programs are written. For example, binary-trees Go #6 program is no longer shown because it doesn't do what's required.