Years ago i was naive enough to believe these benchmarks. Now i know these are Potemkin-village level stunts and political maneuvering by language activists and staff of that site. If you really want actual benchmarking you have to do it yourself and read the .asm output for comparison. Another caveat is that some languages are genuinely faster in one hyperoptimized case(even faster than C) but fail horribly when thi…
How do you read an asm output for PHP, python, erlang, Lua, Java, JavaScript?
Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
111–120 of 132 posts
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#112Earlier quoted context omitted.
You provided zero evidence for your claim. I'm not saying you're necessarily wrong, but so far you have only made an assertion. If you think some language is misrepresented in that benchmark, you can submit your own solution.
The problem is subjective and thus more difficult to provide evidence for. I don't think the parent doubts the runtimes or is claiming that the code for his pet language wasn't written properly and therefore the site is a sham. The issue is: what is reasonable code? Benchmarks invariably become a game of massaging the code to produce the optimal assembly. And that's the problem. The reason that we invented higher lev…
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#113Earlier quoted context omitted.
The problem is subjective and thus more difficult to provide evidence for. I don't think the parent doubts the runtimes or is claiming that the code for his pet language wasn't written properly and therefore the site is a sham. The issue is: what is reasonable code? Benchmarks invariably become a game of massaging the code to produce the optimal assembly. And that's the problem. The reason that we invented higher lev…
Have you looked at the winning submissions code? Every single one I saw (not all of them) was just a straightforward implementation of the algorithm / solution. I don't see much weirdness.
Or the ruby ones. Not much like ruby I have ever seen. It's not particularly difficult to write C code that can be easily called from ruby which is why I guess most ruby programmers wouldn't bother to write code like this in ruby. If you want C, just write C!
I think all the implementations are straightforward as implementations. But few are the most idiomatic way to express the alogorithm in that language.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#114Earlier quoted context omitted.
I had the same observation. I'm a Perl fan, but I can see some submissions were solely motivated to make Perl appear competitive. Like using threads in Perl, which isn't often done in real life. I'm not sure how much evidence is needed. It seems obvious that people who are fans of language X are going to submit code with the sole intention of bumping up performance at any cost. The site is still interesting, but prob…
Doesn't matter, if you don't use threads in Perl when you could, that's your fault and benchmarks like this serve to remind you should. There are folks who use threads with their Perl code in real life btw
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#115So 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.
Speed is not the problem. Amongst many other issues, php has a terrible security track record compared to other languages VMs/compilers.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#116Earlier quoted context omitted.
Python is as easy to write as PHP, but deploying it as a web app is a whole different story.
That comparison is complicated: it's definitely easy to drop a .php file on a server but once you start talking about frameworks, using a newer version than your OS distribution shipped, adding C extensions, etc. it's easy to find counter-examples, and the Go proponents are not wrong to observe that deploying a single file is easier than either. This is also becoming less of a distinguishing factor in the container e…
If you really, really try it's possible in Python, C# and Java too, but ... wtf.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#117Does anybody know why Go binary-trees is so much slower than Java's?
Binary-trees is allocation bottlenecked, and Java has bump pointer allocation where Go has slow allocation. The root cause being that Go's GC is non-moving so it can't do bump pointer allocation without fragmentation, so it has to do a whole bunch of computation to find a place for each node.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#118So 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.
It's not necessarily a performance issue, unless you're Facebook (traffic wise) you might never worry about that, but it's more about the developers who use PHP[0] it's a mixed bag of below junior level to senior level developers. It's hard to know which type of codebase you will get your hands on until you do. There's other issues I personally have with it, though I use it if it's not code I can easily reinvent with…
Facebook hasn't spent a lot of time worrying about their choice of PHP either. Facebook's primary language is Hack, a mostly compatible derivative of PHP. Prior to Hack (~2014) Facebook used traditional PHP, which they reimplemented a couple times for performance reasons. It seems that Facebook has spent its time worrying about how NOT to leave PHP.
Makes one wonder about the value of this daily new programming language era we're in at the moment.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#119Earlier quoted context omitted.
Have you looked at the winning submissions code? Every single one I saw (not all of them) was just a straightforward implementation of the algorithm / solution. I don't see much weirdness.
Yes. For example I noticed the typescript one. The implementation is straightforward, yes, but it is just plain javascript. It doesn't need TSC at all. So why call it typescript? If you're going to say it is typescript at least use types, no? Or the ruby ones. Not much like ruby I have ever seen. It's not particularly difficult to write C code that can be easily called from ruby which is why I guess most ruby program…
Specifically which "ruby ones"? (Currently 37 programs are shown.)
>> the most idiomatic way One person's idiomatic is another person's idiotic.
Re: Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby, Perl, Go, Lua, Rust
#120Years ago i was naive enough to believe these benchmarks. Now i know these are Potemkin-village level stunts and political maneuvering by language activists and staff of that site. If you really want actual benchmarking you have to do it yourself and read the .asm output for comparison. Another caveat is that some languages are genuinely faster in one hyperoptimized case(even faster than C) but fail horribly when thi…
How do you read an asm output for PHP, python, erlang, Lua, Java, JavaScript?