So PHP is faster on most of those test than python or ruby ? I'm I missing something ? I thought everyone hating PHP ( also) because it was slow.
php7 was threatened by hhvm and was completely rewritten by keeping backcompat. It's now the fastest major old scripting language. js and luajit are in the very fast ballpark, php in the middle and the other 3 far behind. PHP also has the best language features and IDE integrations, the only remaining problem is the legacy stdlib and devbase. Ruby with an inliner and method cache would catch up, but I don't see it ha…
Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
61–70 of 132 posts
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#62The 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?lan...
>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.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#63Earlier quoted context omitted.
> 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.
That'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.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#64Therefore, any large-margin differences are benchmarking the programmer not the technology.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#65So PHP is faster on most of those test than python or ruby ? I'm I missing something ? I thought everyone hating PHP ( also) because it was slow.
The means that a lot of rather bad (inexperienced?) programmers use it, which means there is a lot of bad PHP code out there.
People see that bad code and assume the language is bad.
The language has some warts and inconsistencies, and people are eager to point them out as justification for their hate. But for real programming most of them hardly matter.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#66Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#67So PHP is faster on most of those test than python or ruby ? I'm I missing something ? I thought everyone hating PHP ( also) because it was slow.
Since PHP5, the lead team made progress into making it solid. And in PHP7 some eastern/russian guy hacked the VM a lot. Adding new traits and improving memory usage and performance a lot too.
The "hatred" comes from old days (v3,v4):
- massive inconsistency in naming
- global side effect was a norm
- bugs, bugs, bugs
Combined with the nascent web boom, tons of new kids (that includes me) started having fun with html/php. A large mass of the web was written with it, carrying all the bad design decisions in forms of security bugs and impossibly bad code.ps: I audited one famous wordpress plugin and it was 10 pages long of redundant code in 3 big loops, dead code everywhere, commented code released in production. All this to add a few links here and there.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#68Does anybody know why Go binary-trees is so much slower than Java's?
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#69Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#70If you're a competent programmer, one should be able to make any real-world task take about the same time in any two languages. Therefore, any large-margin differences are benchmarking the programmer not the technology.
I don't think that's a practical claim. Interpreted or JIT compiled languages depend on the interpreter or VM. JavaScript has become much faster over time as JavaScript VMs have improved, independent of the details of any particular JavaScript program. Ruby has become faster over time for the same reason. I've seen Ruby programs I've written speed up significantly without any significant code changes when I moved from an older to a newer version of Ruby.