Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Performance of field access

simtec

2008-05-23


Author LoginPost Reply
Hi!

I have a simple Derby table with many thousands of points. I have to
iterate over these points many times to compute distance from x and y
coordinates.

@Entity
class Point
{
Double x;
 Double y;
getter/setter ...
}

   * OpenJPA 1.0.2
   * Derby 10.4.1.3 (Embedded)
   * Non-EE use

I realised that field access (e.g. point.x) of detached objects is much
faster than field access of attached objects (by a factor of 4). Also
access is much faster if I do not enhance the point class. Why is this?
Does OpenJPA check the database on every field access if the object is
attached? What can I do to improve performance of attached objects?

Thanks for any help, Valentin



©2008 gg3721.com - Jax Systems, LLC, U.S.A.