[jboss-user] [JBoss Seam] - Re: DOCTYPE definition on *pages.xml performance warning/imp

lowecg2004 do-not-reply at jboss.com
Fri Jun 1 07:31:16 EDT 2007


I added some basic timing code to Pages.class for the following methods.  Both call getDocumentRoot():


  | package org.jboss.seam.core;
  | 
  | ...
  | 
  | public class Pages {
  |    ...
  | 
  |    private void parse(InputStream stream)
  |    {
  |       long t1 = System.nanoTime();
  | 
  |       ...
  |       
  |       long t2 = System.nanoTime();
  | 
  |       System.out.println("pages1: handling = " + (t2 - t1) / 1000000);
  |    }
  | 
  |    private void parse(InputStream stream, String viewId)
  |    {
  |       long t1 = System.nanoTime();      
  |       ...
  |       long t2 = System.nanoTime();
  | 
  |       System.out.println("pages2: handling = " + (t2 - t1) / 1000000);
  |    }
  | 
  |    ...
  | }

My test is to define 2 simple pages that had a linked to each other.  So clicking the link should produce test output for request and response phases and hopefully show the cost of parsing for a page transition.

Test 1: DOCTYPE was correct for verion 1.3 for pages.xml and test.page.xml - average time spent parsing and processing *pages.xml for a request/response cycle was 48ms.

Test 2: DOCTYPE was set to 1.2 for for pages.xml and test.page.xml; running CVS Seam 1.3 - average time spent parsing and processing *pages.xml for a request/response cycle was 958ms.

More detailed data is below:

Test 1: DOCTYPE was correct for verion 1.3

t1 -> t2
pages1: handling = 11
pages2: handling = 12
pages2: handling = 8
pages1: handling = 9
pages2: handling = 7

total: 47ms

t2 -> t1
pages1: handling = 9
pages2: handling = 10
pages2: handling = 15
pages1: handling = 11
pages2: handling = 9

total: 54ms

t1 -> t2
pages1: handling = 9
pages2: handling = 8
pages2: handling = 9
pages1: handling = 15
pages2: handling = 10

total: 51ms

t2 -> t1
pages1: handling = 9
pages2: handling = 12
pages2: handling = 7
pages1: handling = 9
pages2: handling = 5

total: 42ms

----------------------

Test 2: DOCTYPE was incorrect for verion 1.3

t1 -> t2
pages1: handling = 415
pages2: handling = 138
pages2: handling = 141
pages1: handling = 145
pages2: handling = 140

total: 976ms

t2 -> t1
pages1: handling = 366
pages2: handling = 129
pages2: handling = 129
pages1: handling = 132
pages2: handling = 129

total: 885ms

t1 -> t2
pages1: handling = 405
pages2: handling = 149
pages2: handling = 142
pages1: handling = 145
pages2: handling = 143

total: 984ms

t2 -> t1
pages1: handling = 411
pages2: handling = 144
pages2: handling = 141
pages1: handling = 146
pages2: handling = 146

total: 988ms


Test was done an a dual Xeon 2.8Ghz/2Gb RAM.  App was warmed by navigating between test pages 10 times before taking timings.

[ServerInfo] Java version: 1.6.0_01,Sun Microsystems Inc.
[ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.6.0_01-b06,Sun Microsystems Inc.
[ServerInfo] OS-System: Windows XP 5.1,x86

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050463#4050463

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050463



More information about the jboss-user mailing list