Webware vs. PHP - performance comparision!!!

Lothar Scholz llothar at web.de
Mon Oct 6 02:45:49 EDT 2003


I guess the main difference is that webware has this typical "i'm to
stupid to write in two languages" problem. Everything is done in
python.

Because your code is very short the overhead, request/response parsing
etc., is completely done in 'C' on the PHP side but written in python
on the 'webware' site. Also webware has a lot of unnecessary
historical code that is written for compatibility and flexibility and
not really optimized for a fastest possible servlet response model.

The other main thing is that your PHP code is handled by the same
code/thread/process in the apache server. With an Ideal IP stack
implementation there isn't any need for a task switch. But in Webware
you must

1) apache reads from socket
1) apache write into the socket stream for the webware application
server
2) switch to to application server process context 
3) read from socket
4) start thread (if not already in thread pool)
5) process servlet
6) write response to socket 
7) switch back to apache
8) apache must read the socket
9) apache writes into into the HTTP socket connection.


Again, PHP only needs step 1+5+9. 

The other steps has a lot of overhead, i wished that someone would
start to write an apache embedded application server in python. Don't
now if Apache 2 is able to use only exact 1 process for itself.

The theory is that webware is useful for larger highly interactive
applications.
If you can cache data in memory you must not repeat SQL queries all
the time and win a lot of time. But i doubt that someone has checked
this on a larger application.

I don't make any estimation about speed in this area anymore. I lost a
few Euros because i told a friend that i can't believe that caching
data in the database is faster then writing it to a writing/reading a
temporary file.




More information about the Python-list mailing list