Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 89939 invoked from network); 28 Feb 2006 16:16:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Feb 2006 16:16:28 -0000 Received: (qmail 7138 invoked by uid 500); 28 Feb 2006 16:16:02 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 6557 invoked by uid 500); 28 Feb 2006 16:15:58 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 6491 invoked by uid 99); 28 Feb 2006 16:15:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2006 08:15:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of brandon.goodin@gmail.com designates 66.249.92.201 as permitted sender) Received: from [66.249.92.201] (HELO uproxy.gmail.com) (66.249.92.201) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2006 08:15:50 -0800 Received: by uproxy.gmail.com with SMTP id u40so479458ugc for ; Tue, 28 Feb 2006 08:15:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MOuGAXPzagig351NqQLuxAYJTk2k+vlbo7Bnzj+0E63nhmkjIqt7UXecEgAxWctaREkRO7XpWeUR4ijBz2OJaYQzLM8BLXyqkWUTnGeHb8Y24YfsacnMzR6iHZT35QH/hYdui55RXR4IyDUOjC+q3+Mq+GAhToPfyLZn7Zh7c1Y= Received: by 10.67.88.11 with SMTP id q11mr427268ugl; Tue, 28 Feb 2006 08:15:28 -0800 (PST) Received: by 10.66.245.17 with HTTP; Tue, 28 Feb 2006 08:15:28 -0800 (PST) Message-ID: <2fe5ef5b0602280815u578fd949m6120a95221cdc5e0@mail.gmail.com> Date: Tue, 28 Feb 2006 08:15:28 -0800 From: "Brandon Goodin" To: user-java@ibatis.apache.org Subject: Re: performnace of iBATIS In-Reply-To: <44046112.5080008@aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <21b.8da9367.3135128c@aol.com> <16178eb10602272259j1717c789k476efbb54e76cd7a@mail.gmail.com> <44046112.5080008@aol.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Please post all the code you use to test jdbc and ibatis. There are a few mistakes that people can often make. One is that you don't perform the resultset to object translation. The next is that the test could be loading the sqlmap each time it is run. iBATIS will have initial overhead because it is parsing and loading the sqlmaps into memory. Brandon On 2/28/06, Tony Qian wrote: > Clinton and all, > > Let me first thank you guys for quick response. I believe we have the be= st > tech support among open source community, either from iBATIS team or from > iBATIS users. > > I used a very simple query which fetches all records in the table (72 > rows). Here are some info for my test. > > database: MySql 5.0, query cache is turned on. > iBATIS setting: > > enhancementEnabled=3D"true" > lazyLoadingEnabled=3D"false" > maxRequests=3D"32" > maxSessions=3D"10" > maxTransactions=3D"5" > useStatementNamespaces=3D"false" /> > > > xml mapping for query: > type=3D"com.netscape.isp.business.management.session.SimpleSessionParamet= er"/> > > > Java code: > try{ > long stime =3D System.currentTimeMillis(); > Context ctx =3D new InitialContext(); > DataSource dataSource =3D (DataSource) > ctx.lookup("java:comp/env/jdbc/quickstart"); > Connection connection =3D dataSource.getConnection(); > Statement stmt =3D connection.createStatement(); > String sql =3D "SELECT parameter_id, parameter_name, descrip= tion > FROM SESSION_PARAMETER;" ; > stmt.execute(sql); > ResultSet rS =3D stmt.getResultSet(); > List list =3D new ArrayList(); > if (rS.first()) { > do { > list.add(new SimpleSessionParameter( > rS.getString("parameter_id"), > rS.getString("parameter_name"), > rS.getString("description"))); > } while (rS.next()); > } else { > throw new NotFoundException("no records were found"); > } > rS.close(); > stmt.close(); > out.println("executing time is " + (System.currentTimeMillis= () > - stime) + > " current time =3D" +System.currentTimeMillis() + " > startTime =3D " + stime); > stime =3D System.currentTimeMillis(); > List parameter =3D new SimpleSessionParameterList(); // > basically it calls "list =3D sqlMap.queryForList("getSessionParameterLis= t", > null);" > out.println("Ibatis executing time is " + > (System.currentTimeMillis() - stime) + > " current time =3D" > +System.currentTimeMillis() + "startTime =3D " + stime); > }catch (Exception e){ > out.println(" get exception" + e.getMessage()); > } > > > Test results: > JDBC executing time is 30 current time =3D1141136720755 startTime =3D > 1141136720725 > Ibatis executing time is 100 current time =3D1141136720855startTime =3D > 1141136720755 > > JDBC executing time is 40 current time =3D1141136723448 startTime =3D > 1141136723408 > Ibatis executing time is 110 current time =3D1141136723558startTime =3D > 1141136723448 > > JDBC executing time is 20 current time =3D1141136725741 startTime =3D > 1141136725721 > Ibatis executing time is 100 current time =3D1141136725841startTime =3D > 1141136725741 > > executing time is 30 current time =3D1141137529882 startTime =3D 1141137= 529852 > Ibatis executing time is 101 current time =3D1141137529983startTime =3D > 1141137529882 > > I appreciate your help. > Tony > > Clinton Begin wrote on 2/28/2006, 1:59 AM: > > > Post your test code, and I'll show you what's wrong with it. > > Clinton > > > > On 2/27/06, DaqiQian2@aol.com wrote: > > Sven, > > thanks for your response. I did some preliminary test on iBATIS' > performance. For JDBC (MySql 5.0), i recorded time from establishing > connection, result set, and mapping the result to objects. For list of > simple objects, it seems to me that iBATIS (no caching and lazyloading) i= s > 3-5 times slower than using JDBC. Of course, i believe my xml mapping has > room to improve. > > The reason I asked is that I need some stats to persuade myself and > coworkers to accept iBATIS as a data persistence tool for our relatively > heavily loaded servers. > > btw, we just pushed a project using iBATIS to QE. For that project, > performance is not big issue. > > Thanks, > Tony > >