https://blog.famzah.net/2016/02/09/cpp-vs-python-vs-perl-vs-...
https://blog.famzah.net/2016/02/09/cpp-vs-python-vs-perl-vs-...
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
But I think, what's important to note is that PHP 7 has improved in speed department by a great deal.
Java-8 is using java.util.regex which is written in Java, PHP is passing the regex requests to it's own regex process which is actually a C package and performs a lot faster.
What we're actually comparing here is:
time(java.util.regex) > time(php compilation + c regex package)
No, the fastest Java program shown does not use java.util.regex
The fastest Java program shown uses com.basistech.tclre
> a C package and performs a lot faster <
You're welcome to contribute a Java program that uses the PCRE library --
Back in 2012:
"5) The idea is to help you understand that you aren't comparing what you say you're comparing.
If your intention is to compare time taken to grow a list, then shouldn't you start with lists that are the same size, and start with program heap that's the same size, and use the same max heap size?
user+sys for your Java program = 20.56s
But change ArrayList<Integer> s = new ArrayList<Integer>();
to ArrayList<Integer> s = new ArrayList<Integer>(8192);
and run with java -Xms1G PrimeNumbersBenchmarkApp
user+sys = 6.9s
I don't think you're comparing what you say you're comparing."http://www.famzah.net/download/langs-performance/java-discus...
You seem unnecessarily argumentative about this, almost like you're angry and I really don't understand why. There really isn't that much difference between languages like Ruby and PHP to warrant this and almost anything can be expressed in almost the same way, the only real differences are syntactic sugars and the "flexible" type system.
Modern PHP frameworks and tools are good, perhaps even excellent. Composer and the PSR-# efforts have spurred a renaissance in code quality and interoperability, and PHP7 brings some truly impressive speed improvements. For those of us who aren't stuck supporting legacy code, that is. One of these days I will be working with a language whose syntax I enjoy, but until then the language that puts the "sin" in "syntax" will (for better or worse) keep getting the job done.
plus like you say PHP might be faster to get started with but becomes much slower on larger projects due to inconsistent error handling and language design.
"Will your toy benchmark program be faster if you write it in a different programming language? It depends how you write it!" ;-)
Don't trust everything you read on the internet, run the benchmark yourself and see if that result is actually reproducible. (Depends on the heap size.) There is also a "non-std lib" java test case, which doesn't generate as much garbage and, of course, performs much better.