A Comparative Study between Dynamic Web Scripting Languages
A Comparative Study between Dynamic Web Scripting Languages
net/publication/256404467
CITATIONS READS
6 9,924
3 authors:
Joydip Dhar
ABV-Indian Institute of Information Technology and Management Gwalior
235 PUBLICATIONS 1,805 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Exploitation and Conservation of Forestry Resources using Mathematical Models. View project
A New Computational Approach to Identify Essential Genes in Bacterial Organisms Using Machine Learning View project
All content following this page was uploaded by Joydip Dhar on 23 May 2014.
1 Introduction
HTML, which stands for Hyper Text Markup Language is a text and image formatting
markup language employed by web browsers to format web pages. It was first proposed
by Tim Berners-Lee [1, 16]. It has become exponentially more popular since then,
expanding beyond a small group of computer-science visionaries to the personal and
business sectors. Today, it’s almost a household word. As the utilization of World Wide
Web intensified, static HTML web pages were rendered inadequate considering the
growing requirements of mankind [2]. Earlier, web servers used to employ the basic
HTTP protocol. Once they received a client request, they would reply with a static
document containing only HTML content. However, gradually massive content began
to be required which had to be saved on the web server. This led in the consumption of
heavy storage area at the server side for big applications thus culminating into the waste
R. Kannan and F. Andres (Eds.): ICDEM 2010, LNCS 6411, pp. 288–295, 2012.
© Springer-Verlag Berlin Heidelberg 2012
A Comparative Study between Dynamic Web Scripting Languages 289
of resources at the server side [3]. As a remedial measure, dynamic web scripting
languages were introduced. A dynamic web scripting languages is a language which
reacts to a user’s action. They are used to embed interactivity to otherwise static Web
pages. They can also automatically fill up parts of Web-based forms, among other uses.
Science zine [4] described the capabilities of JavaScript, a popular Web scripting
language: "Without any network transmission, an HTML page with embedded Java-
Script can interpret the entered text and alert the user with a message dialog if the input
is invalid. Or you can use JavaScript to perform an action (such as play an audio file,
execute an Applet, or communicate with a plug-in) in response to the user opening or
exiting a page."
One of the first dynamic scripting languages was Common Gateway Interface
(CGI). Using CGI the web programmers were able to produce scripts which were able
to read input parameters and return an HTML page meeting specific user requirements)
[5]. Development of CGI led to the hunt for more sophisticated and robust web
scripting languages. PHP (Hypertext Preprocessor) followed the era of CGI. It is one of
the most heavily used dynamic web scripting languages in the world. It is widely used
to implement lightweight web applications and to access databases and other kinds of
middleware. It was originally developed by Rasmus Lerdorf in 1995 [6]. It is open
source software released under the PHP license. It can be easily embedded into an
HTML source document. Then after, it can be interpreted by a web server with a PHP
processor module generating the web document.
JavaServer Pages (JSP) is a technology which uses Java as supporting language. It
aims at allowing programmers to utilize the vast capability of Java in building their web
applications [9]. It by released by Sun Microsystem in 1999. It may be considered as a
high-level abstraction of Java servlets. JSP pages are loaded in the server and operated
from a Java server packet, often packaged as a .war or .ear file archive. It allows Java
code and certain pre-defined actions to be intermixed with static web markup content,
with the resulting page being compiled and executed on the server to deliver an HTML
or XML document. The compiled pages and any dependent Java libraries use Java
bytecode rather than a native software format, and must therefore be executed within a
Java virtual machine (JVM) that integrates with the host operating system to provide an
abstract platform-neutral environment.
ASP.NET is a web application framework designed by Microsoft to facilitate building
web sites, web applications and web services. It follows a code behind model i.e. it deals
with the dynamic program code by placing them in a separate file or in a separate tag [8].
Thus, it allows the designers and coders to work separately. It permits the programmers to
build applications using an event-driven GUI model, rather than in conventional
web-scripting environments like CGI, PHP, Python etc. The framework employs existing
utilities such as JavaScript with internal components like "ViewState" to bring persistent
state to the inherently stateless web environment. The ASP.NET in itself is not a pro-
gramming language. It is built on a Common Language Runtime(CLR) allowing the
programmers to choose any language form a wide pool of languages such as Python ,
VB.NET, C#.NET J#, Delphi.NET, Chrome etc to code the web application under
consideration. A complete list of languages allowed in ASP.NET is given on [10].
The table below depicts a brief comparison between PHP, ASP.NET and JSP based
on some general parameters.
290 A. Ranjan, R. Kumar, and J. Dhar
The table given below depicts sample codes of PHP, JSP and ASP.NET outputting
Hello World!
In this paper, we intend to study the impact of three different and famous web
scripting languages viz. PHP, JSP, ASP.NET on the performance of a web server.
Although a wide variety of languages can be used with ASP.NET, in our study, we have
used C# along with it. We conduct experiments on some standard benchmarks using
both built-in modules and self- written codes.
In our experiments, we have used the client- server architecture having both clients
and servers residing on the same system. These types of systems are advantageous for
debugging and testing purpose of web script language programming. While building
any application, a programmer can test on his own computer whether the application is
working as per his expectations or not. If not, he can change the application right on his
computer. These tasks can be performed without the overhead of uploading the codes
on any distant server time and again. Examples of such systems include LAMP,
WAMP, and SAMP etc.
2 Literature Survey
There has been a heavy research evaluating the performances of static and dynamic
web contents. In paper [11], a sophisticated study was performed about the effect of
dynamic contents on the performance of web servers. It was revealed that it is ex-
tremely slow to retrieve a web page when coupled with a dynamic scripting language,
in this case Common Gateway Interface (CGI), than when it is a plain static web page.
In paper [12], the authors concluded that the personalization of web pages comes at a
price. The processing required for dynamic web pages and the overhead arising out of the
database access often result in a negative impact on the performance of the web server.
The authors have quantified each of these effects. They determined that these effects as a
whole diminish up to a factor of 8 the highest request rate bolstered by any user. The
results obtained by them suggested that Java outperformed both PHP and Perl. They also
inferred that web server performances under overload can be quite unpredictable. They
also concluded that PHP, Perl and Jetty which are dynamic content generation technology
are quite robust while some other technologies such as Resin are not.
In paper [13], Ramana studied the performances of MySQL and PHP components in
the Linux environment using LAMP (Linux, Apache, MySQL, PHP) architecture.
They built a web application with the help of LAMP and measured the performance
with respect to the application. They quantified the improvement in performance that
would increase if one was coded in C as against PHP. They also did some application
level benchmarking comparative study on the performance of the application on Linux
and Windows environments. They concluded that Apache outperforms Windows with
IIS when the program was coded in PHP and the persistence was with MySQL. They
also showed that Windows armed with Apache, PHP and MySQL falls in between.
Cecchet et al., in paper [14], compared three middleware architectures for generating
dynamic web contents: PHP, Java servlets, and Enterprise Java Beans (EJB). They
attached PHP to the Web server. They set the database interfaces in PHP to be adhoc
and wrote it separately for each and every database. They determined that Java servlets
execute independently rendering independence from any particular database. They
achieved so doing all database operations using JDBC. EJB employed a component
based approach which was platform-independent. It divided the business logic and the
presentation logic in different tiers. Also the code for auction site using Java servlets
was lengthier than that employing PHP implementation. The same holds for the online
bookstore. They concluded that Java tools and safety properties associated with it did
help in debugging, but it also required multiple re-casts posing many trade-offs be-
tween typed and untyped languages. Although EJB was determined to be quite easy to
use, as it did not require written SQL queries, the implementation done by the authors
required more lines of code in Java than in that required in servlets. It was due to the
fact that they required many interfaces which were required to be implemented to
structure the application logic into beans. PHP scripts were determined to be more
efficient than Java servlets in terms of performance. However, PHP scripts were tied to
the Web server and provided limited functionality and runtime support whereas Java
servlets execute in a different process from the Web server. The authors used it to
achieve better performance when web server is proved to be the bottleneck. The
authors determined that servlets can be used to improve performance if there is data-
base lock contention application. They also concluded that EJB offers the most flexible
A Comparaative Study between Dynamic Web Scripting Languages 293
architecture. EJB offers maany software engineering qualities such as modularity, ppor-
tability, and maintainability
y. However it was determined that the EJB is less efficiient
than the Java servlets and PHP.
P
In paper [15], the authorrs presented three benchmarks for dynamic web sites w with
differing characteristics: an
n online bookstore, an auction site, and a bulletin boaard.
They carried out bottleneck k characterization of the benchmarks.
3 Experiments and
d Analysis
In order to compare the perfformances between PHP, JSP and ASP.NET, we have uused
the following versions of thhe languages under consideration. These are the latest vver-
sions of the above three lan
nguages.
• PHP 5.3.2
• JSP 2.1
• ASP.NET 4.0 (Miccrosoft .NET framework)
In order to carry out the ex
xperiments, we have used a machine possessing 1 GB m main
memory and a 1.83 GHz du ual core processor with windows XP service pack 2 as the
operating system. We used Apache
A 2.2.6, Apache Tomcat 6.0.26 and IIS 7.5 as the w
web
servers.
We compared the three languages
l on the basis of the following four benchmarkss,
• Finding the factoriial of 100 (factorial benchmark).
• Determining wheth her a random word having 1 million characters is a paalin-
drome or not (palinndrome benchmark).
• Sorting a list of 1 million random integers using merge sort [17] (merge sort
benchmark).
• Running Dijkstra’ss algorithm on a graph with 1000 nodes and 5000 edges [[18]
(Dijkstra benchmaark).
250
200
0
Factorial palindro
ome Merge Sort Dijkstra
300
250
200 PHP 5.3.2
150 JSP 2.1
100
ASP.NET 4.0
50
0
Factorial palindrome Merge Sort Dijkstra
Fig. 4.
4 Execution time using built-in modules
We conducted experiments on the above four benchmarks using the three languaages
under consideration. We useed both self-written codes and built-in modules of the abbove
four benchmarks in all the three languages. In ASP.NET we actually used C# siince
ASP.NET in itself is not a language
l rather it is a framework. We conducted 1000 ttests
on each benchmark with eacch language and calculated the total runtime of the executiion.
xecution time of the three languages over 1000 tests on the
Fig.3 depicts the total ex
four benchmarks using selff-written codes. Similarly Fig. 4 depicts the total executtion
time of the three languagees over 1000 tests on the four benchmarks using buillt-in
modules.
References
1. Berners-Lee, T., Connolly, D.: Hypertext Markup Language – 2.0, RFC1866, MIT/W3C
(1995)
2. Govindaraju, M., Slominski, A., Chiu, K., Liu, P., Engelen, R.V., Lewis, M.J.: Toward
Characterizing the Performance of SOAP Toolkits. In: Proceedings of the 5th IEEE/ACM
International Workshop on Grid Computing (2004)
3. Berners-Lee, T., Fielding, R.T., Nielsen, H.F.: Hypertext Transfer Protocol — HTTP/1.0,
Internet RFC 1945 (1996)
4. Science zine, http://encyclozine.com/technology/computer/internet
/web/JavaScript
5. Coar, K., Robinson, D.: The WWW Common Gateway Interface version 1.1, Internet draft
(1999)
6. Lerdorf, R.: Programming PHP. O’Reilly Media, California (2002)
7. Berson, A.: Client/server architecture. McGraw-Hill Companies, New York (1992)
8. MacDonald, M.: ASP.NET: The Complete Reference. McGraw-Hill Companies, New York
(2002)
9. Hanna, P.: JSP 2.0: The Complete Reference. McGraw-Hill Companies, New York (2003)
10. dotnetpowered Language List,
http://www.dotnetpowered.com/languages.aspx
11. Yeager, N., McGrath, R.: Web Server Technology: The Advanced Guide for World Wide
Web Information Providers. Morgan-Kaufmann Publishers, Inc., San Francisco (1996)
12. Titchkosky, L., Arlitt, M., Williamson, C.: A Performance Comparison of Dynamic Web
Technologies. In: 11th IEEE/ACM International Symposium on Modeling, Analysis and
Simulation of Computer Telecommunications Systems (2003)
13. Ramana, U., Prabhakar, T.: Some Experiments with the Performance of LAMP Architec-
ture. In: Proceedings of the 2005 Fifth International Conference on Computer and Infor-
mation Technology (2005)
14. Cecchet, E., Chanda, A., Elnikety, S., Marguerite, J., Zwaenepoel, W.: Performance
Comparison of Middleware Architectures for Generating Dynamic Web Content. In:
Endler, M., Schmidt, D.C. (eds.) Middleware 2003. LNCS, vol. 2672, pp. 242–267.
Springer, Heidelberg (2003)
15. Amza, C., et al.: Specification and implementation of dynamic Web site benchmarks. In:
Proceedings of the 5th IEEE Workshop on Workload Characterization (2002)
16. Berners-Lee, T.: Information Management: A Proposal, CERN (1990)
17. Dijkastra, E.J.: A note on two problems in connection with graphs. Numerische Mathe-
matic, pp. 269–271(1959)
18. Knuth, D.E.: Sorting by Merging. The Art of Computer Programming. Addison-Wesley,
Massachusetts (1998)