Tuesday, March 28, 2006

JBoss Web Server = Tomcat Native / APR

JBoss Web Server is built on Apache Tomcat and includes Apache Portable Runtime (APR) and Tomcat native technologies (Tomcat Native) to achieve good scalability and performance. It is a new open source project that will provide enterprises with a single, high-performance deployment platform for Java Server Pages (JSP) and Java Servlet technologies, Microsoft ASP.NET, PHP and CGI.
They say that it can excess Apache HTTP Server. It is interesting how much it really does.

Saturday, March 18, 2006

PHP-Java Integration

Types of interoperation scenarios between Java and PHP are twofold.
  • SAPI (Server Application Programming Interface) like Servlet PHP, CLI, etc. - PHP on Java (to integrate PHP into a Java Servlet environment)
  • Java extension in PHP - Java in PHP (to integrate Java support into PHP)
The PHP configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI version, it happens on every invocation.

Types of implementation are as follows:
A product available is:
Check it out!

Monday, March 13, 2006

JSR-292 invokedynamic - a New Java Bytecode Instruction for Dynamically Typed Language Support

Recent Java VM often needs to interpret scrypts written in dynamically typed languages. The common langauges used include JavaScript, whose reference implementation is available with JSR 223. Performantly executing this kind of interpretation is not so much simple. Naive interpretation is known to be 10-100 times slow.

Compiling or translating programs in foreign languages into the language directly supported by the platform, which is Java bytecode for Java VM in this case, is typical approaches to good performance. Instead of interpreting method calls in JavaScript, we can translate/compile them to native Java method calls and execute them directly on Java VM.

The compiling/translating approach involves, however, plenty of code generation in some cases. Too much generated code consumes too much memory and thus can result in poor performance.

Gilad Bracha, the fourth man of Java, has been pointing out this problem in his blog, and finally proposed a new Java VM instruction, specialized to address this issue on Feb 28, 2006.
It is in the JSR review ballot stage, and to be approved in Mar 13, 2006.

Friday, March 10, 2006

PHP Script Caching

PHP, a scripting language for template-based dynamic page generation, is often compiled at runtime implicitly. This is for making its execution faster, comparing to interprit it without compilation. In normal PHP engine, this compilation occurs whenever each page accessed.

The overhead of compilation can be avoided if the result of compilation in the previous execution of the same PHP page is remembered by the engine. This technique is well-known and sometimes called script caching. In a PHP engine with script caching, it caches each PHP script in a compiled state so that it can reuse the cache for another page (script) access.

Here, I listed links to major, freely-available caching plugins for the standard PHP engine.