reffec.com

Comparing framework performance in Java Print Code-128 in Java Comparing framework performance

Comparing framework performance use java barcode 128 integration tomake code 128a with java iPad One day you might be ask spring framework Code 128 Code Set A ed at a job interview "Which framework would you use for best performance " That"s a tough question, which requires some additional input to produce a comprehensive answer. However, should you have plain Servlet/JSP on one checkbox and JSF on another, be sure to go for the first option..

[ 255 ]. Tuning Web Applications on JBoss AS Why is JSF slower than p lain Servlet/JSP stuff If you think about it, when you request a simple JSP page, the client makes an HTTP request for the page, and the server responds with the page translated into HTML. As a result, a single path is executed to render the content to the output stream. The following image depicts this simple process:.

On the other hand, a Jav servlet Code 128 Code Set B a Server Faces page is represented by a tree of UI components, called a View. When a client makes a request for the page, a complex life cycle starts. During the life cycle, the JSF implementation must build the View while considering the state saved from a previous submission of the page.

When the client submits a page, the JSF implementation must perform several tasks, such as validating the data input of components in the View and converting input data to types specified on the server side. The JSF implementation performs all these tasks as a series of steps in the life cycle. The following image will give you an idea of the complexity of the JSF life cycle.

. [ 256 ]. 9 . Although the JSF lifecyc le is hardly set in stone (you can change the order of execution by skipping phases or leaving the lifecycle altogether), customizing the lifecycle of JSF is s a non-trivial task and a deep understanding of the JSF architecture is required to get it right. So where do we go after this preamble Chiefly to one point: To evaluate web frameworks not just on the basis of productivity and cool widgets but also with performance in mind. In the following sections, we will compare the performance of two common web tasks, displaying tabular and hierarchical data, using different approaches.

The numbers we will collect do not represent, as usual, a definitive truth since they are dependant on the type of application tested, on the kind of hardware used, and finally on the release of the component library used. What we will try to establish is an order of magnitude among several approaches, which must be a part of your wealth of knowledge..

The performance of tabular data The HTML table is one of the most common constructs in a web application. Besides its usefulness when laying out components on a page, a table can display rows of data from a collection. Trying to gather the most popular alternatives, we will consider these three possible options to iterate over the data: Use a Servlet/JSP-based solution Use a JSF solution, running the Mojarra JSF 1.

2 implementation. Use the RichFaces 3.3 component library with the Mojarra JSF 1.

2 implementation. In our test, we will sup jdk Code 128A pose that the user needs to browse a table containing 10 columns and 50 rows. The first, barebone solution, will require just to iterate through the collection of elements created on the server side:. <c:forEach var="bean" items="${list}"> ${bean.column1} ${bean.column2} .

. . .

. . .

. . .

. . .

</c:forEach>. [ 257 ]. Tuning Web Applications on JBoss AS The corresponding benchm Code 128 Code Set A for Java ark, built upon a total of 250 concurrent users, follows here:. The second benchmark use s JSF"s dataTable built-in UI component:. <h:dataTable value="# tomcat Code 128 Code Set A {list}" styleClass="myStyle" rowClasses="odd,even" var="bean"> . . .

. . .

. . .

. . .

.. And here"s the correspon ding outcome, from JMeter:. Finally, we will test a Code-128 for Java rich:dataTable, powered by the JBoss Richfaces 3.3 suite:. <rich:dataTable value ="#{list}" styleClass="myStyle" rowClasses="odd,even" var="bean"> . . .

. . .

. . .

. . .

.. This is the last benchma jsp USS Code 128 rk produced:. The numbers we have coll ected tell us that a simple JSP solution is about 2.5 times faster than the Mojarra"s JSF 1.2 implementation and over 3 times faster than the RichFaces 3.

3 library.. [ 258 ].
Copyright © reffec.com . All rights reserved.