I have converted code to use BitSet , but see no better performance (not trivial to test). BitSet creates "small" arrays It is important for some JVM implemetations (not trivial to handle memory fragmentation), but possible optimizes nothing on current implementations. possible there is no optimization and breaks a lot of public methods : TypeFactory: /** * Determine if any of the given field values are dirty, returning an array containing indexes of * the dirty fields or <tt>null</tt> if no fields are dirty. */ public static BitSet findDirty(Type[] types, Object[] x, Object[] y, BitSet check, SessionImplementor session) throws HibernateException { BitSet results = null; for (int i=0; i<types.length; i++) { if ( check.get(i) && types[i].isDirty( x[i], y[i], session ) ) { if (results==null) results = new BitSet( types.length ); results.set(i);
} } return results; } ---------------------------------------------------------------------------- AbstractEntityPersister: /** * Determine if the given field values are dirty */ public BitSet findDirty(Object[] x, Object[] y, Object object, SessionImplementor session) throws HibernateException { return TypeFactory.findDirty(propertyTypes, x, y, propertyUpdateability, session); } ---------------------------------------------------------------- Some callback must be the most performant way : callback.begin( types, x, y, persiter, session ); for (int i=0; i<types.length; i++) { if ( check.get(i) && types[i].isDirty( x[i], y[i], persiter, session ) ) { callback.handleDirty( i, types[i], x[i], y[i], persiter, session ); //generates UPDATE, //does not need to check deleted and "new" objects } } callback.end( types, x, y, persiter, session ); My current implementation with BitSet produces error at this time (FooBarTest), is it Ok in current cvs version ? > I was just having a look over the source of BitSet. It doesn't seem to me > that it would be more performant than a simple boolean[]. (It would > probably consume less _memory_, but that doesn't seem to be a very > critical issue here.) Juozas, why do you expect there to be a performance > gain from using BitSet? > > ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel