Just as php python is a widely used easy to read and write on-the-fly interpreted language.

performance?

performance in the sense of data throughput or amount of prime numbers per second but it is also: how long will a user or other process have to wait for that data to be processed and request to finish?

Machines can wait, but humans should never have to wait for machines, because their time is limited.

in terms of speed-of-data-processing the top list is like:

  1. C still (mostly) holds the performance crown 😀
  2. C++ and RUST (C++ often being faster, but RUST more (memory-wise) secure)
  3. GO (yes it is really a bit slower than RUST, wow who would have thought that?)
  4. PHP
  5. Python

(there is an interesting site that tries to benchmark languages by performance)

But if the large data can be processed incremental in smaller parts (process part A, maybe output A, process next part B…) also python and php can process GBytes of data.

more detailed list:

source code secs mem gz
Intel C 23.34 11,052 427
C gcc #2 25.22 11,112 406
C gcc 26.27 11,112 427
Go #2 26.53 11,112 494
Go 27.22 11,112 462
Java 29.53 41,244 439
C# .NET 47.52 30,452 465
PHP #2 143.01 12,992 391
PHP #3 163.38 13,004 412
PHP 204.22 12,976 384
Ruby #2 19 min 25,596 307
Ruby 20 min 25,492 335
Python 3 #3 23 min 11,064 384
Python 3 #2 30 min 11,192 330
Python 3 1h 03 min 11,032 373
Matz’s Ruby 2h 35 min 11,052 335
Matz’s Ruby #2 3h 13 min 11,056 307

conclusion:

speed matters but does this mean that php and python are bad just because they are slow?

no they have their specific use-case, such as python is heavily used for automation, while php is heavily used for web development.

And while a website embedded into a webserver written in c would give the MOST speed, most devs would POSSIBLY use the tested-over-many-years-of-time-LAMP setup.

PS: How to convert Python code to Cython (and speed up 100x)?

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin