[jboss-user] [JBoss Seam] - Re: JBoss EL performance vs Sun EL
mgrouch
do-not-reply at jboss.com
Tue Sep 18 00:23:57 EDT 2007
To avoid guess here is a test case
| import java.io.Serializable;
|
| import org.jboss.seam.annotations.Name;
|
| @Name("testBean")
| public class TestBean implements Serializable {
|
| public final static int ROWS = 1000;
| public final static int COLS = 10;
| public final static int ITEMS = 100;
|
| private String data[][][] = new String[ROWS][COLS][ITEMS];
|
| public TestBean() {
| for (int i=0; i<ROWS; i++) {
| for (int j=0; j<COLS; j++) {
| for (int k=0; k<ITEMS; k++) {
| data[j][k] = "[" + i + "," + j + "," + k + "]";
| }
| }
| }
| }
|
| public String[][][] getData() {
| return data;
| }
|
| public void setData(String[][][] data) {
| this.data = data;
| }
| }
|
JSF
| <table>
| <tbody>
| <tr>
| <ui:repeat value="#{testBean.data}" var="row" varStatus="index">
| <td>
| <ui:repeat value="#{row}" var="col">
| <select>
| <ui:repeat value="#{col}" var="item">
| <option value="#{item}">#{item}</option>
| </ui:repeat>
| </select>
| </ui:repeat>
| </td>
| </ui:repeat>
| </tr>
| </tbody>
| </table>
|
JSP
| <%@page import="com.mydomain.biz.bean.TestBean"%>
| <html>
| <head>
| </head>
| <body>
| <table>
| <%
| TestBean bean = new TestBean();
| for (int i=0; i<TestBean.ROWS; i++) {
| %>
| <tr>
| <%
| for (int j=0; j<TestBean.COLS; j++) {
| %>
| <td>
| <select>
| <%
| for (int k=0; k<TestBean.ITEMS; k++) {
| String data = bean.getData()[j][k];
| %>
| <option value="<%=i%>_<%=j%>_<%=k%>"><%=data%></option>
| <%
| }
| %>
| </select>
| </td>
| <%
| }
| %>
| </tr>
| <%
| }
| %>
| </table>
| </body>
| </html>
|
I don't have profiler handy, but I swear it was EL functions which topped the list in it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085316#4085316
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085316
More information about the jboss-user
mailing list