|
From: <php...@li...> - 2007-07-26 06:54:29
|
I'm a PHP programmer tasked with calling Java code written by someone else. I successfully installed the Bridge on my Windows machine. I wrote PHP script that calls Java code using the DYNAMIC LOAD method. It works but the web page that contains the PHP script loads very slowly (15-20 seconds) the first time, but a bit faster the succeeding times (5 seconds).
What the Java code does is supposedly simple, it reads a short string value from a relational database, and passes it to PHP script to display. Oh, but the Java code requires a lot of libraries like log4j, dom4j, asm, xom, etc. (more than 20 of them).
My immediate question is: Is there a way to improve performance, especially the first time the webpage (PHP script) is loaded?
My deeper question is:
What happens exactly with "dynamic loading"? Is the sequence of events below accurate?
1) User requests for a web page that contains a PHP script that calls Java code.
2) The system loads all Java base classes (libraries).
3) The system loads the Java Virtual Machine (JVM).
4) The system loads all Java libraries needed by the PHP script.
5) The system executes the Java code.
What happens exactly with "static loading"? Is this sequence of events accurate?
0) User starts up the welcome page of a web application.
The system loads all Java base classes (libraries) AND
the Java Virtual Machine (JVM).
1) User requests for a webpage that contains a PHP script that calls Java code.
2) The system loads all Java libraries needed by the PHP script.
3) The system executes the Java code.
Regards,
Filip
Send instant messages to your online friends http://uk.messenger.yahoo.com
|