Performance Comparison of Web Service Engines in PHP, Java, and C

Introduction Web service technology, especially that based on WS-*, plays a key role for the realization of Service Oriented Architecture. However, it is difficult to argue that web services are as widely used as assumed when the technology was first emerged. Potential reasons include the performance problem of XML processing, too many complicated WS-* standards, and so forth. Recent technologies seen in the Web 2.0 era have arisen through the community driven approach, where average programmers are playing the key role as they use it. From this viewpoint, one of the biggest reasons for the above unpopularity is the software productivity and performance disadvantages. The PHP language is widely used as a popular server side language [7]. A great number of open source software and company’s web sites use PHP since it can enable high software productivity. Moreover, PHP officially offered SOAP support in version 5. Thus, this support helped boost the wide spread use of web services based on SOAP/WS-*. In this paper, we describe a thorough comparative study of PHP and Axis2, the major open source SOAP engine implementation from a qualitative and quantitative perspective. Please note that we do not argue that PHP is better than other programming languages which provide web services support, but rather we focus on a neutral comparison. The structure of this paper is as follows. Section 2 describes an overview of Axis2 and the SOAP extension in PHP. Section 3 describes the qualitative comparison in terms of programming model, deployment model, WS-* standard support, and other functionalities. Next, Section 4 describes the quantitative comparison using a benchmark called StockQuote web service and WSTest, and in Section5, we summarize the comparison in web services runtime between PHP, Java, and C. We conclude this paper by introducing related works in Section 6, along with conclusions and future works in Section 7.

Overview of Web Services Runtimes The main objective of this paper is to demonstrate how the PHP SOAP engine is different from web services engines implemented in various programming languages. Today there are many commercial products and open source software that provide a web services engine, but in this paper we use two engines available from the Axis2 project, a Java-based implementation and a C-based implementation. As described detail later in this paper, in terms of software productivity and ease of deployment, the C-based implementation is not more straightforward than runtimes based on languages such as Java and PHP. However, we use it mainly for performance comparison to understand the best possible performance. Next we will provide an overview of PHP and its web services runtime, and Axis2.

Qualitative Comparison This section presents a comparative study between web services support provided by PHP and Axis2 from variety of perspectives including software architecture, the XML processing model, WS-* standard support, the programming model and deployment model for server providers, the support for RESTful service, and other functionalities.

Quantitative Comparison This section describes a quantitative comparison among 3 SOAP engines: the SOAP engine in PHP5, Axis2 Java, and Axis2 C. Especially for PHP, we also compare two web servers, Lighttpd [9] and Apache 2.

Discussion In this section, we will summarize the overall comparison based on our qualitative and quantitative test results described in the previous sections, and also our experience when conducting these experiments. . PHP vs. Java One of the main reasons the good performance seen with the PHP web services stack comes from the use of the fastest xml parser, libxml2, which is written in C. Regarding interfacing with C modules, PHP’s extension API is designed for high efficiency (but not for robustness or portability), while the Java Native Interface (J NI) is designed for robustness and portability rather than for efficiency. If we used libxml in the Java WS stack, it would cause a significant overhead due to frequent expensive call-ins from C to Java. Please also note that the xml parser written in java is slower than in C because of Java’s inefficient handling of strings and of disallowing (potentially type-unsafe) pointer arithmetic. However, for more system stability and productivity for some expert programmer, Java is surely in a good position. PHP vs. C The performance of the stock quote web service experiment demonstrates that Axis2 C performs well in comparison to other SOAP engines. Axis2 C is implemented in C, but this performance score might be expected but since Axis2 is designed to be highly modular. It is not well known whether Axis2 C still outperforms the PHP SOAP engine, which has been designed around with a monolithic approach and is also written in C. However, from the point of view of productivity, programmability, ease of deployment, and debuggability, it is well behind the other engines. Especially in terms of ease of debugging, it is not straightforward to debug web services written for Axis2 C, as the relationship between resulting core dumps from segmentation faults and the original web service definitions is not obvious. PHP as a SOAP engine Considering the recent trend of popular programming languages, PHP fulfills the fundamental language requirements of productivity and performance. Even though Java can meet these requirements, since PHP is used in a variety of web applications and SOAP and WS-* has not yet been successful used in the public space (with the exception of certain robust enterprise applications), we claim that that PHP is in a good position.