Re: slow performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zoltán Németh wrote:

>>>> 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.

But as far as I understand, java kinda does the same thing, doesn't it?
Java programs are being compiled into some intermediate language, and
this is being interpreted at runtime. So using an accelerator should
mimic the same setup for php.

Do you know any resource, describing how php works (like the thing about
compiling opcode, and stuff)? How does php handle simultaneous requests?
Are there multiple threads spawned?



-- 
... There are 10 kinds of people. Those who know binary code, and those
who don't.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux