db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: PersistentField implementations, dramatic performance differences
Date Sat, 26 Jun 2004 09:20:49 GMT
Hi,

Thomas Dudziak wrote:
> Brian McCallister wrote:
> 
>> AutoProxyImpl performance will probably be terrible =) It switches on 
>> an exception because of reflection's behavior =(
> 
> 
> Nope, after I added a check against the SecurityManager it now can use 
> the PersistentFieldDirectAccessImpl (or 
> PersistentFieldDirectAccessImplNew for that matter), so performance is 
> quite good:

Fine, now only the performance of nested fields is slow.

> I wonder though why there are 0's for the getter in the above tests ?
> 

Your PC is too fast ;-)
I think that the JVM has problems (bug) when
System.currentTimeMillis()
was called.
It seems that under specific conditions this method returns the same 
value more than one time although more than one ms is passed.
Try this test on your machine

public void testA() throws Exception
{
     long result[] = new long[50];
     for (int i = 0; i < result.length; i++)
     {
         result[i] = System.currentTimeMillis();
         Thread.sleep(1);
     }

     for (int i = 0; i < result.length; i++)
     {
         System.out.println("time: " + result[i]);
     }
     System.exit(0);
}

>> Once it does so it *should* remember how to access the same field 
>> again though.
> 
> 
> Since we have one PersistentField per FieldDescriptor, the 
> PersistentField will be initialized only once per persistent field, so 
> the time necessary for initialization doesn't really matter. And after 
> that it uses a different impl anyway.
> 

I added a test case for PersistenceFields (PersistenceFieldTest), it 
seems that PersistenceFieldAutoProxyImpl isn't work properly. The test 
does not pass.
The test use non-nested, nested fields and fields specific to 
Introspector (metadata name is compilant with javabeans, but class field 
name differs).

Armin

> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message