It's been a long time since the last time I wrote a post.
I'm installing a web environment and I'm trying to make it as efficient as possible,
so I've decided to make a benchmark between Php and python
I've tried these two web environments:
Php: default configuration (php5 + Apache)
Python: Cherokee webserver+fcgi+PsycoCherokee is a minimalist web server like nginx. I decided to use this web server since I've read
that it is more efficient than apache, according to several benchmarks.
Psyco is a JIT Compiler for python that compiles chunks of code to make it faster when executing.
The benchmark consists of a fuzz of 1000 requests using 50 parallel threads.
This was the result (Y axis:System Load , X axis:Time)

I know that php can be optimized, but this was a simple benchmark that I made to test
my new environment, however it evaluates default php installations.
I hope you begin to port to Python ;D
Let's see how HipHop works
Bye!
Pd: That was the script I used
- def func():
- primeNumbers = []
- output = []
- for i in xrange(2, 30000):
- divisible = False
- for number in primeNumbers:
- if i % number == 0:
- divisible = True
- if divisible == False:
- primeNumbers.append(i)
- output.append(str(i))
- print "".join(output)
- func()
- $output = '';
- for ($i = 2; $i 30000; $i++) {
- $divisible = false;
- foreach ($primeNumbers as $number) {
- if ($i % $number == 0) {
- $divisible = true;
- }
- }
- if ($divisible == false) {
- $primeNumbers[] = $i;
- $output .= $i;
- }
- }
- echo $output;