Hi Ben,

After some further investigations, I've gone back to the Person, Student classes in 
the release examples.

Seems that the aop interception is happening during access of objects, and that 
accessing objects contained within objects significantly increases access times. Here 
is the setup I used.

1. Add the following lines into the "Person" class:

Vector myHobbies = new Vector();

public void addHobby(Hobby theHobby)
{
  myHobbies.add(theHobby);
}

public Vector getHobbyVector()
{
  return myHobbies;
}


2. Create a new class "Hobby"

public class Hobby
{

   String name = null;
   
   public Hobby(String theName)
   {
      name = theName;
   }
   
   public Hobby()
   {
   }

   public String getName()
   {
      return name;
   }

   public void setName(String name)
   {
      this.name = name;
   }


   public String toString()
   {
      return "name=" + getName();
   }

}


3. Create objects:
1000 Students adding 10 "Hobby" instances to each student via the addHobby() method in 
the Person class.


4. Add each Student instance into a TreeCacheAop instance and also into a Vector 
(myVector).

5. Iterate:

Do a query on the Vector (myVector)...

Object[] array = myVector.toArray();
Student a = null;
String hobbyName;
Vector hobVect = null;
Object[] hobarray = null;
for (int i=0; i<array.length; i++)
{
  a = (Student) array;

  // test 1
  hobbyName = a.getName();

  // test 2
  hobVect = a.getHobbyVector();
  hobArray = hobVect.toArray();

  // test 3
  loop through hobArray calling "getName()" on each
  

}

Results:

test 1 - duration = 100ms
test 2 - 430ms
test 3 - 530 ms

Seems to me that as soon as you access the Vector of objects (hobbies) under each 
Student is where the performance hit is kicking in?

I'll try and put this into a JUnit test for you tomorrow.

Hope the above sheds some light.

Any ideas so far?

Many thanks

Ken


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

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


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to