Skip to content

SpeedTest

Yong Zhu edited this page Nov 28, 2018 · 2 revisions

Performance testing of various SQL writing methods

The following is the performance test of jSqlBox different SQL writing to loop 100,000 CRUD operations, the test source is found in [source code here] (../blob/master/core/src/test/java/com/github/drinkjava2/helloworld/UsuageAndSpeedTest .java), running on the H2 in-memory database (i7 CPU), can eliminate the impact of disk reads and writes, reflecting the performance of the framework itself.

Compare method execute time for repeat 100000 times:
                           pureJdbc: 0.735 s
            xxxxStyleWithConnection: 0.819 s
                          xxxxStyle: 0.940 s
                          nXxxStyle: 1.0 s
                          iXxxStyle: 1.272 s
                          pXxxStyle: 1.345 s
                      INLINEmethods: 1.162 s
                          tXxxStyle: 4.874 s
                    dataMapperStyle: 2.774 s
                  activeRecordStyle: 2.706 s
         activeRecordDefaultContext: 2.586 s
                   sqlMapperUseText: 12.824 s
              sqlMapperSqlAnnotaion: 12.518 s
           abstractSqlMapperUseText: 17.939 s

It can be seen that the slowest SQL method is the last three SqlMapper patterns, which implement multi-line text support and abstract class instantiation.

Performance comparison test between entity CURD method and other ORM tools

The author of BeetlSQL has made a persistence layer tool performance comparison test project, see [Dao-Benchmark project] (https://gitee.com/xiandafu/dao-benchmark), which focuses on the CRUD performance of the test entity, excluding Performance testing of the underlying JDBC method.

The following is a test result map: image