Hi ,
   These days I test ibatis  performance with large result set and large bean. I do following step,
   1.  A bean have  84 properties  and a tabble have 84 columns.
   2. and I set enhencmentEnable=true, 
   3. I query 10000 result from oracle database. Oracle database with JDBC driver set  defaultRowFetch=50.
  Above calling take about 1700ms -1800ms. JDBC query take about 200ms.
  But  when I check my bean code, I found there is a property with no get method, so I add the property's Getter Method. 
  Then I get a surprised, The query formance got a great improvement.  It is take about 1200ms-1300ms. 
  I debug ibatis code, I find follwing code may cause  big performance:

  com.ibatis.sqlmap.engine.accessplan.AccessPlanFactory Line 60
      if (bytecodeEnhancementEnabled) {
        try {
          plan = new EnhancedPropertyAccessPlan(clazz, propertyNames);
        } catch (Throwable t) {
          try {
            plan = new PropertyAccessPlan(clazz, propertyNames);
          } catch (Throwable t2) {
            plan = new ComplexAccessPlan(clazz, propertyNames);
          }
        }
      }
com.ibatis.common.beans.ClassInfo Line256
 public Method getGetter(String propertyName) {
    Method method = (Method) getMethods.get(propertyName);
    if (method == null) {
      throw new ProbeException("There is no READABLE property named '" + propertyName + "' in class '" + className + "'");
    }
    return method;
  }

class EnhancedPropertyAccessPlan/PropertyAccessPlan  call com.ibatis.common.beans.ClassInfo.getGetter(String) that  cause an exception  when a bean have no Getter method, AccessPlan object choose ComplexAccessPlan.
 
 I think ComplexAccessPlan cause the performance problem.
 
 IBtatis automatic decide a simple bean that property have no Getter method to be  Complex type.  IBatis does not prompt any warning  enhancementEnable option will be skipped. I think these ibatis exception handling is not smooth.  and If user's bean loose some Getter method,  a common user does not know why  ibatis performance become bad.

BR
Leon Liu


   
   
 
  

Reply via email to