지난주 토요일에 하이버네이트 도입 관련된 질문을 받고 “성능”에 대해서 왈가왈부 했지만, 사실 전 한번도 하이버네이트와 iBatis의 성능비교를 해본 적이 없습니다. 마침 관련된 회사일도 있고해서 성능 테스트를 만들어 봤습니다. iBatis에 유리한 테스트 코드라고 생각하고 작성한 코드인데… 무언가 문제가 있는지 하이버네이트가 더 빠르게 나왔습니다. @_@;;

사용한 DB는 HSQL입니다. 프로젝트는 맨 아래 다운로드 할 수 있도록 해두겠습니다.

iBatis는…

[xml]
<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>com.springsource.com.ibatis</artifactId>
<version>2.3.4.726</version>
</dependency>
[/xml]

Hibernate는…

[xml]
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>com.springsource.org.hibernate</artifactId>
<version>3.3.2.GA</version>
</dependency>
[/xml]

빈 설정은…

[xml]
<jdbc:embedded-database id="dataSource" type="HSQL">
<jdbc:script location="classpath:sqlScript/schema.sql"/>
</jdbc:embedded-database>

<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="SqlMapConfig.xml" />
</bean>

<bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
<constructor-arg name="sqlMapClient" ref="sqlMapClient"/>
</bean>

<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory"/>

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="sample.domain" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
</bean>
[/xml]
평범합니다.

iBatis DAO 구현체는? 너무 평범해서 패스;; 그냥 소스코드를 보셔도 됩니다. github에 올려놔야겠네;

암튼 그래서.. 테스트 코드는…

[java]
@Test
@Repeat(50)
public void add5000(){
    //GIVEN
    List&lt;Member&gt; member5000 = MemberTestUtils.makeMember5000();
   
    //WHEN
    StopWatch watch = new StopWatch();
    watch.start();
    for(Member newMember : member5000) {
        memberDao.add(newMember);
    }
    memberDao.flush();
    watch.stop();
    System.out.println(watch.prettyPrint());
   
    //THEN
    assertThat(memberDao.list().size(), is(1000));
}

@Test
@Repeat(50)
public void select5000(){
    //GIVEN
    List&lt;Member&gt; member5000 = MemberTestUtils.makeMember5000();
    for(Member newMember : member5000) {
        memberDao.add(newMember);
    }
    memberDao.flush();
    System.out.println("insert 5000 complete!");
   
    //WHEN
    StopWatch watch = new StopWatch();
    watch.start();
    List&lt;Member&gt; members = memberDao.list();
    memberDao.flush();
    watch.stop();
    System.out.println(watch.prettyPrint());
   
    //THEN
    assertThat(members.size(), is(1000));
}
[/java]
이 테스트 코드는 하이버네이트를 테스트 할 때 사용한 코드라서 중간 중간 flush()가 들어가 있는데, iBatis를 테스트 할 때도 같은 코드를 사용했고, 대신 flush()만 빠져있다.

결과를 보자.

1. iBatis: insert 5000

StopWatch '': running time (millis) = 361
-----------------------------------------
ms     %     Task name
-----------------------------------------
00361  100% 

StopWatch '': running time (millis) = 255
-----------------------------------------
ms     %     Task name
-----------------------------------------
00255  100% 

StopWatch '': running time (millis) = 195
-----------------------------------------
ms     %     Task name
-----------------------------------------
00195  100% 

StopWatch '': running time (millis) = 146
-----------------------------------------
ms     %     Task name
-----------------------------------------
00146  100% 

StopWatch '': running time (millis) = 127
-----------------------------------------
ms     %     Task name
-----------------------------------------
00127  100% 

StopWatch '': running time (millis) = 106
-----------------------------------------
ms     %     Task name
-----------------------------------------
00106  100% 

StopWatch '': running time (millis) = 95
-----------------------------------------
ms     %     Task name
-----------------------------------------
00095  100% 

StopWatch '': running time (millis) = 94
-----------------------------------------
ms     %     Task name
-----------------------------------------
00094  100% 

StopWatch '': running time (millis) = 93
-----------------------------------------
ms     %     Task name
-----------------------------------------
00093  100% 

StopWatch '': running time (millis) = 100
-----------------------------------------
ms     %     Task name
-----------------------------------------
00100  100% 

StopWatch '': running time (millis) = 89
-----------------------------------------
ms     %     Task name
-----------------------------------------
00089  100% 

StopWatch '': running time (millis) = 85
-----------------------------------------
ms     %     Task name
-----------------------------------------
00085  100% 

StopWatch '': running time (millis) = 72
-----------------------------------------
ms     %     Task name
-----------------------------------------
00072  100% 

StopWatch '': running time (millis) = 62
-----------------------------------------
ms     %     Task name
-----------------------------------------
00062  100% 

StopWatch '': running time (millis) = 56
-----------------------------------------
ms     %     Task name
-----------------------------------------
00056  100% 

StopWatch '': running time (millis) = 51
-----------------------------------------
ms     %     Task name
-----------------------------------------
00051  100% 

StopWatch '': running time (millis) = 40
-----------------------------------------
ms     %     Task name
-----------------------------------------
00040  100% 

StopWatch '': running time (millis) = 38
-----------------------------------------
ms     %     Task name
-----------------------------------------
00038  100% 

StopWatch '': running time (millis) = 31
-----------------------------------------
ms     %     Task name
-----------------------------------------
00031  100% 

StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

StopWatch '': running time (millis) = 36
-----------------------------------------
ms     %     Task name
-----------------------------------------
00036  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

StopWatch '': running time (millis) = 65
-----------------------------------------
ms     %     Task name
-----------------------------------------
00065  100% 

StopWatch '': running time (millis) = 29
-----------------------------------------
ms     %     Task name
-----------------------------------------
00029  100% 

StopWatch '': running time (millis) = 32
-----------------------------------------
ms     %     Task name
-----------------------------------------
00032  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 70
-----------------------------------------
ms     %     Task name
-----------------------------------------
00070  100% 

StopWatch '': running time (millis) = 31
-----------------------------------------
ms     %     Task name
-----------------------------------------
00031  100% 

StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

StopWatch '': running time (millis) = 29
-----------------------------------------
ms     %     Task name
-----------------------------------------
00029  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 29
-----------------------------------------
ms     %     Task name
-----------------------------------------
00029  100% 

StopWatch '': running time (millis) = 53
-----------------------------------------
ms     %     Task name
-----------------------------------------
00053  100% 

StopWatch '': running time (millis) = 32
-----------------------------------------
ms     %     Task name
-----------------------------------------
00032  100% 

StopWatch '': running time (millis) = 32
-----------------------------------------
ms     %     Task name
-----------------------------------------
00032  100% 

StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 168
-----------------------------------------
ms     %     Task name
-----------------------------------------
00168  100% 

StopWatch '': running time (millis) = 30
-----------------------------------------
ms     %     Task name
-----------------------------------------
00030  100% 

StopWatch '': running time (millis) = 37
-----------------------------------------
ms     %     Task name
-----------------------------------------
00037  100% 

StopWatch '': running time (millis) = 33
-----------------------------------------
ms     %     Task name
-----------------------------------------
00033  100% 

StopWatch '': running time (millis) = 33
-----------------------------------------
ms     %     Task name
-----------------------------------------
00033  100% 

StopWatch '': running time (millis) = 29
-----------------------------------------
ms     %     Task name
-----------------------------------------
00029  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

2. iBatis: select 5000

insert 5000 complete!
StopWatch '': running time (millis) = 105
-----------------------------------------
ms     %     Task name
-----------------------------------------
00105  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 64
-----------------------------------------
ms     %     Task name
-----------------------------------------
00064  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 42
-----------------------------------------
ms     %     Task name
-----------------------------------------
00042  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 27
-----------------------------------------
ms     %     Task name
-----------------------------------------
00027  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 28
-----------------------------------------
ms     %     Task name
-----------------------------------------
00028  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 13
-----------------------------------------
ms     %     Task name
-----------------------------------------
00013  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 14
-----------------------------------------
ms     %     Task name
-----------------------------------------
00014  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 15
-----------------------------------------
ms     %     Task name
-----------------------------------------
00015  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 15
-----------------------------------------
ms     %     Task name
-----------------------------------------
00015  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 16
-----------------------------------------
ms     %     Task name
-----------------------------------------
00016  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 17
-----------------------------------------
ms     %     Task name
-----------------------------------------
00017  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 18
-----------------------------------------
ms     %     Task name
-----------------------------------------
00018  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 20
-----------------------------------------
ms     %     Task name
-----------------------------------------
00020  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 19
-----------------------------------------
ms     %     Task name
-----------------------------------------
00019  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 16
-----------------------------------------
ms     %     Task name
-----------------------------------------
00016  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 17
-----------------------------------------
ms     %     Task name
-----------------------------------------
00017  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 10
-----------------------------------------
ms     %     Task name
-----------------------------------------
00010  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 7
-----------------------------------------
ms     %     Task name
-----------------------------------------
00007  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 8
-----------------------------------------
ms     %     Task name
-----------------------------------------
00008  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 8
-----------------------------------------
ms     %     Task name
-----------------------------------------
00008  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 7
-----------------------------------------
ms     %     Task name
-----------------------------------------
00007  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 96
-----------------------------------------
ms     %     Task name
-----------------------------------------
00096  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

3. Hibernate: insert 5000

StopWatch '': running time (millis) = 135
-----------------------------------------
ms     %     Task name
-----------------------------------------
00135  100% 

StopWatch '': running time (millis) = 98
-----------------------------------------
ms     %     Task name
-----------------------------------------
00098  100% 

StopWatch '': running time (millis) = 82
-----------------------------------------
ms     %     Task name
-----------------------------------------
00082  100% 

StopWatch '': running time (millis) = 74
-----------------------------------------
ms     %     Task name
-----------------------------------------
00074  100% 

StopWatch '': running time (millis) = 67
-----------------------------------------
ms     %     Task name
-----------------------------------------
00067  100% 

StopWatch '': running time (millis) = 84
-----------------------------------------
ms     %     Task name
-----------------------------------------
00084  100% 

StopWatch '': running time (millis) = 52
-----------------------------------------
ms     %     Task name
-----------------------------------------
00052  100% 

StopWatch '': running time (millis) = 50
-----------------------------------------
ms     %     Task name
-----------------------------------------
00050  100% 

StopWatch '': running time (millis) = 32
-----------------------------------------
ms     %     Task name
-----------------------------------------
00032  100% 

StopWatch '': running time (millis) = 35
-----------------------------------------
ms     %     Task name
-----------------------------------------
00035  100% 

StopWatch '': running time (millis) = 29
-----------------------------------------
ms     %     Task name
-----------------------------------------
00029  100% 

StopWatch '': running time (millis) = 26
-----------------------------------------
ms     %     Task name
-----------------------------------------
00026  100% 

StopWatch '': running time (millis) = 23
-----------------------------------------
ms     %     Task name
-----------------------------------------
00023  100% 

StopWatch '': running time (millis) = 21
-----------------------------------------
ms     %     Task name
-----------------------------------------
00021  100% 

StopWatch '': running time (millis) = 13
-----------------------------------------
ms     %     Task name
-----------------------------------------
00013  100% 

StopWatch '': running time (millis) = 9
-----------------------------------------
ms     %     Task name
-----------------------------------------
00009  100% 

StopWatch '': running time (millis) = 9
-----------------------------------------
ms     %     Task name
-----------------------------------------
00009  100% 

StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

StopWatch '': running time (millis) = 7
-----------------------------------------
ms     %     Task name
-----------------------------------------
00007  100% 

StopWatch '': running time (millis) = 7
-----------------------------------------
ms     %     Task name
-----------------------------------------
00007  100% 

StopWatch '': running time (millis) = 7
-----------------------------------------
ms     %     Task name
-----------------------------------------
00007  100% 

StopWatch '': running time (millis) = 7
-----------------------------------------
ms     %     Task name
-----------------------------------------
00007  100% 

StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

4. Hibernate: select 5000

insert 5000 complete!
StopWatch '': running time (millis) = 60
-----------------------------------------
ms     %     Task name
-----------------------------------------
00060  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 37
-----------------------------------------
ms     %     Task name
-----------------------------------------
00037  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 22
-----------------------------------------
ms     %     Task name
-----------------------------------------
00022  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 19
-----------------------------------------
ms     %     Task name
-----------------------------------------
00019  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 17
-----------------------------------------
ms     %     Task name
-----------------------------------------
00017  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 12
-----------------------------------------
ms     %     Task name
-----------------------------------------
00012  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 10
-----------------------------------------
ms     %     Task name
-----------------------------------------
00010  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 10
-----------------------------------------
ms     %     Task name
-----------------------------------------
00010  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 10
-----------------------------------------
ms     %     Task name
-----------------------------------------
00010  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 11
-----------------------------------------
ms     %     Task name
-----------------------------------------
00011  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 12
-----------------------------------------
ms     %     Task name
-----------------------------------------
00012  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 12
-----------------------------------------
ms     %     Task name
-----------------------------------------
00012  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 5
-----------------------------------------
ms     %     Task name
-----------------------------------------
00005  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 6
-----------------------------------------
ms     %     Task name
-----------------------------------------
00006  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 3
-----------------------------------------
ms     %     Task name
-----------------------------------------
00003  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

insert 5000 complete!
StopWatch '': running time (millis) = 4
-----------------------------------------
ms     %     Task name
-----------------------------------------
00004  100% 

흠… 신기할세……………….. select는 둘 다 비슷한데, insert는 Hibernate가 iBatis보다 6배 정도 빠르게 나왔다. 예상했던 결과는 “비슷하다” 혹은 “아이바티스가 아주 조금 빠르다.” 정도였는데… 이건 뭐 예상과는 정 반대네.. 흠.. 왜 이러지; @_@;