ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: about bean with no GET method performance
Date Tue, 18 Mar 2008 18:00:19 GMT
>>   Above calling take about 1700ms -1800ms. JDBC query take about 200ms.

Does your JDBC example include creating all of the classes and setting
all of the properties?   Calling resultSet.getXxxxx() and setting
properties 840,000 times in 1.8 seconds actually sounds pretty good.

I hate to discourage you from using iBATIS, but honestly if you're
worried about a 500ms difference in performance of a query of nearly
1,000,000 values, you might be better off without iBATIS.  :-/

Clinton

On Tue, Mar 18, 2008 at 10:32 AM, Leon Liu <ljw2083@alibaba-inc.com> wrote:
>
>  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
>
>
>
>
>
>
>

Mime
View raw message