2007. 04. 25, szerda keltezéssel 11.53-kor Henning Eiben ezt írta: > Zoltán Németh schrieb: > > >> I wrote a small sample-application once using PHP (with propel and > >> smarty) and once using Java (JBoss, EJB3, JSP & Servlets). Both apps are > >> being served from a windows server (2x Xeon 1,3GHz, 2 GB RAM), but the > >> performance of the PHP version is much slower than the Java version. > > > > I think this is because Java is compiled once, PHP is compiled at every > > request... > > Well, but using something like eAccelerator should compensate this, > shouldn't it? As far as I understand, scripts are being compiled and > then store in memory to access them faster. not exactly. it pre-compiles them to opcodes and stores the opcode blocks. the interpreter normally first pre-compiles the code to opcodes then runs the opcode. this pre-compilation can be cached with accelerators, that's how they increase performance. > > >> I already installed an php-accelerator (eAccelator) which increased the > >> overall performance, but still the performance is quite poor. > > > > I would not say php performace is poor, I think it is quite fast (at > > least on my linux boxes, I know nothing about php on windows...) > > Well ... I did some stress-testing. I create 20 concurrent requests to > my application: random pages, randomizing the post parameter, which > causes to load different data from the database (MySQL 5.0.37, running > on a separate server). My webserver is the same for java and php. > > Running my test for about 5 minutes, I get about 31.000 request for the > java application, but only about 3.000 for the php. well, that's strange. I think there should not be that much difference. maybe your php code is written poorly? or maybe your apache serves php in a way which limits the number of threads or some other resource? or else I don't know. (but I'm not a performance guru, wait for answers from some other list members who know much more about this topic than me ;) ) greets Zoltán Németh > > > > -- > ... Does killing time harm eternity? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php