ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Liu <ljw2...@alibaba-inc.com>
Subject Re: about bean with no GET method performance
Date Wed, 19 Mar 2008 01:13:03 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ok, I will test 5 properties bean to validate if the&nbsp; performance issue
will happen.<br>
<br>
I think ibatis is pretty on performance,&nbsp; We use it on our site,&nbsp; every
day, our page hit more than 110 m times,&nbsp; IBatis&nbsp; do all these&nbsp;
very
pretty:)<br>
Some tables in our site have than 80 column, and were queried millions
of times every hour.&nbsp;&nbsp;&nbsp; So, performance is very critical for me
.&nbsp;
Every SQL request handle quickly will get less waiting connection and
more user expierence.&nbsp; <br>
<br>
Query 10000 results are&nbsp; only my test case, In product env ,&nbsp; We fetch
data 20-50 results every query .<br>
<br>
We have more than 200 sql map files,&nbsp; So&nbsp; I can not change any&nbsp;
to&nbsp; my
product system.&nbsp; Improve performance only&nbsp; by tuning sql, modify&nbsp;
some&nbsp;
bean model.<br>
<br>
Leon Liu<br>
&nbsp;<br>
<br>
<br>
Clinton Begin &#20889;&#36947;:
<blockquote
 cite="mid:16178eb10803181100q655e5e90t463ac196581c94b6@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">  Above calling take about 1700ms -1800ms. JDBC query take about
200ms.
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
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 <a class="moz-txt-link-rfc2396E" href="mailto:ljw2083@alibaba-inc.com">&lt;ljw2083@alibaba-inc.com&gt;</a>
wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap=""> 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







    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
<br>
</body>
</html>

Mime
View raw message