You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Sa...@amway.com on 2006/11/09 22:17:41 UTC

ibatis with Spring performance isssue.

We ran performance tests on one of our application with Spring/IBATIS vs
regular JDBC. As far as the response time goes it was roughly the same. But
the CPU usage was 4 to 5 times higher in Spring/IBATIS implementation. Has
anybody encountered the same issue.? Is that is normal Why?

Thanks.

Regards,
Sanjay
x7273


Re: ibatis with Spring performance isssue.

Posted by Chris Lamey <cl...@localmatters.com>.
Make sure you don't include Spring's initialization in your test
measurements.  Building a Spring context takes a lot of CPU time, so
it's best to init Sprint and then start gathering data.

Cheers,
Chris

On Thu, 2006-11-09 at 16:17 -0500, Sanjay_Deshpande@amway.com wrote:
> We ran performance tests on one of our application with Spring/IBATIS vs
> regular JDBC. As far as the response time goes it was roughly the same. But
> the CPU usage was 4 to 5 times higher in Spring/IBATIS implementation. Has
> anybody encountered the same issue.? Is that is normal Why?
> 
> Thanks.
> 
> Regards,
> Sanjay
> x7273
> 

Re: ibatis with Spring performance issue.

Posted by Sa...@amway.com.
Thanks  Larry for your quick Response. Here is our SQLMAP-config file
details.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0
//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
      <!-- These settings control SqlMapClient configuration details,
primarily to do with transaction
            management. They are all optional (more detail later in this
document). -->
      <settings  cacheModelsEnabled="true" enhancementEnabled="true"
            lazyLoadingEnabled="true" maxRequests="512" maxSessions="256"
            maxTransactions="32" useStatementNamespaces="true"
classInfoCacheEnabled="true"
            errorTracingEnabled="false"/>


      <sqlMap
            resource="SqlMap.xml" />

</sqlMapConfig>

The query in SqlMap.xml is as follows

<resultMap id="detailMap" class="com.mycompany.dto.Detail">
      <result property="typeCode" column="typeCode" columnIndex="1" />
      <result property="xAmount" column="xTotal" columnIndex="2" jdbcType=
"DECIMAL" />
      <result property="yAmount" column="yTotal" columnIndex="3" jdbcType=
"DECIMAL"/>
      <result property="numberOfCustomers" column="numberOfCustomers"
columnIndex="4" jdbcType="DECIMAL"/>
      <result property="numberOfOrders" column="numberOfOrders" columnIndex
="5" jdbcType="DECIMAL" />
      <result property="currency" column="currency" columnIndex="6" />
</resultMap>


<select id="getDetailInformation" resultMap="detailMap"  remapResults=
"false"
             parameterClass="java.util.Map"  >
             SELECT JLAWPK as typeCode,SUM(JLAWPL) as xTotal, SUM(JLAWPM)
as yTotal, SUM(JLAWPN) as           numberOfCustomers, SUM(JLAWPO) as
numberOfOrders, JLK2CD as currency
             FROM Table1
             WHERE JLAEPA = #idNumber:DECIMAL# AND JLAF4H =
#period:DECIMAL# AND JLAWPK = #transactionCode:VARCHAR#
             GROUP BY JLAEPA, JLAF4H, JLAWPK, JLK2CD
</select>



The data Base is AS400. We are running this on Websphere 6.1.

When we run the JProfiler for both the JDBC and spring-iBatis
implementation on this test Application , we notice that the  CPU
utilisation is very high in case of the spring-ibatis implementation.

Please advise us on how we can configure ibatis to resolve this issue.  If
needed we will provide the detailed Profiler trace.





                                                                           
             "Larry Meadors"                                               
             <lmeadors@apache.                                             
             org>                                                       To 
             Sent by:                  user-java@ibatis.apache.org         
             larry.meadors@gma                                          cc 
             il.com                                                        
                                                                   Subject 
                                       Re: ibatis with Spring performance  
             11/09/2006 04:45          isssue.                             
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
             user-java@ibatis.                                             
                apache.org                                                 
                                                                           
                                                                           




Heh, well...there are about 4,890,456,354 ways to configure that. :-)

So, I guess if it's within your performance criteria don't worry about
it. If it's not, look at it with a profiler and see what you can do to
make it better. If it is a deficiency in the framework, we'll see what
we can do to improve it.

Larry


On 11/9/06, Sanjay_Deshpande@amway.com <Sa...@amway.com> wrote:
>
> We ran performance tests on one of our application with Spring/IBATIS vs
> regular JDBC. As far as the response time goes it was roughly the same.
But
> the CPU usage was 4 to 5 times higher in Spring/IBATIS implementation.
Has
> anybody encountered the same issue.? Is that is normal Why?
>
> Thanks.
>
> Regards,
> Sanjay
> x7273
>
>



Re: ibatis with Spring performance isssue.

Posted by Larry Meadors <lm...@apache.org>.
Heh, well...there are about 4,890,456,354 ways to configure that. :-)

So, I guess if it's within your performance criteria don't worry about
it. If it's not, look at it with a profiler and see what you can do to
make it better. If it is a deficiency in the framework, we'll see what
we can do to improve it.

Larry


On 11/9/06, Sanjay_Deshpande@amway.com <Sa...@amway.com> wrote:
>
> We ran performance tests on one of our application with Spring/IBATIS vs
> regular JDBC. As far as the response time goes it was roughly the same. But
> the CPU usage was 4 to 5 times higher in Spring/IBATIS implementation. Has
> anybody encountered the same issue.? Is that is normal Why?
>
> Thanks.
>
> Regards,
> Sanjay
> x7273
>
>