gweMysql Driver vs Connector/J
3.0.1 Beta Profiling Simple Test Case |
Target test case - testSelect.java |
import java.net.URL; import java.sql.*; public class testSelect { public static void test() { try { String url = "jdbc:mysql://localhost:3306/test?useUnicode=true"; Connection con = DriverManager.getConnection(url, "root", "XXXX"); Statement stmt = con.createStatement(); String query = "select * from foo"; ResultSet rs = stmt.executeQuery(query); while( rs.next() ) { int intval = rs.getInt("col1"); String strval = rs.getString("col2"); } rs.close(); stmt.close(); con.close(); } catch( Exception e ) { e.printStackTrace(); } } public static void main(String[] args) { try { Class.forName(args[0]).newInstance(); for(int i = 0; i < 1000; i++) test(); } catch( Exception e ) { e.printStackTrace(); } } } |
Environment | |
Profiler | Borland Optimizeit Profiler |
Profiling Option | No Garbage Collection mode |
Java VM | Java HotSpot(TM) Client VM (build 1.3.1_04-b02, mixed mode) |
OS | Windows2000 SP2 |
CPU | PentiumIII 700MHz |
Memory | 256MB |
RDBMS | MySQL-Max 3.23.51 |
Table definition & data | create table foo(col1 INTEGER PRIMARY KEY,
col2 VARCHAR(128) NOT NULL); INSERT INTO foo values(1, 'ken'); |
gwe.sql.MysqlDriver 2002/09/23 |
Class name | Instance count | Difference | Size | Size difference |
---|---|---|---|---|
char[] | 61074 | + 61074 | 4211 K | + 4211 K |
byte[] | 58973 | + 58973 | 129239 K | + 129239 K |
java.lang.String | 42072 | + 42072 | 1479 K | + 1479 K |
Object[] | 17009 | + 17009 | 731 K | + 731 K |
java.util.Hashtable$Entry | 15000 | + 15000 | 527 K | + 527 K |
java.lang.StringBuffer | 10010 | + 10010 | 273 K | + 273 K |
java.lang.Integer | 7999 | + 7999 | 156 K | + 156 K |
gwe.sql.gweMysqlStringBuffer | 6995 | + 6995 | 191 K | + 191 K |
java.util.Hashtable | 4999 | + 4999 | 253 K | + 253 K |
java.lang.ref.Finalizer | 3001 | + 3001 | 105 K | + 105 K |
java.lang.ref.SoftReference | 2999 | + 2999 | 105 K | + 105 K |
sun.io.CharToByteMS932 | 2001 | + 2001 | 117 K | + 117 K |
sun.io.CharToByteJIS0201 | 2001 | + 2001 | 117 K | + 117 K |
gwe.sql.gweMysqlColumn | 2000 | + 2000 | 85 K | + 85 K |
java.util.ArrayList | 2000 | + 2000 | 54 K | + 54 K |
java.util.Properties | 1999 | + 1999 | 101 K | + 101 K |
java.util.Hashtable$Enumerator | 1998 | + 1998 | 101 K | + 101 K |
int[] | 1008 | + 1008 | 85 K | + 85 K |
java.io.FileDescriptor | 1001 | + 1001 | 19 K | + 19 K |
sun.io.ByteToCharMS932 | 1000 | + 1000 | 66 K | + 66 K |
java.lang.Object | 1000 | + 1000 | 19 K | + 19 K |
gwe.sql.gweMysql | 1000 | + 1000 | 105 K | + 105 K |
java.io.DataOutputStream | 1000 | + 1000 | 27 K | + 27 K |
gwe.sql.gweMysqlPacket | 1000 | + 1000 | 66 K | + 66 K |
gwe.sql.gweMysqlMetaResult | 1000 | + 1000 | 27 K | + 27 K |
gwe.sql.gweMysqlResultSetCore | 1000 | + 1000 | 58 K | + 58 K |
java.net.Socket | 1000 | + 1000 | 19 K | + 19 K |
java.net.SocketOutputStream | 1000 | + 1000 | 27 K | + 27 K |
java.io.DataInputStream | 1000 | + 1000 | 27 K | + 27 K |
java.net.PlainSocketImpl | 1000 | + 1000 | 58 K | + 58 K |
sun.io.ByteToCharJIS0201 | 1000 | + 1000 | 42 K | + 42 K |
java.net.SocketInputStream | 1000 | + 1000 | 35 K | + 35 K |
gwe.sql.gweMysqlConnection | 1000 | + 1000 | 66 K | + 66 K |
gwe.sql.gweMysqlResultSetBuffer | 1000 | + 1000 | 58 K | + 58 K |
gwe.sql.gweMysqlStatement | 1000 | + 1000 | 58 K | + 58 K |
java.net.Socket$1 | 999 | + 999 | 19 K | + 19 K |
sun.security.action.GetPropertyAction | 999 | + 999 | 27 K | + 27 K |
java.net.Socket$2 | 999 | + 999 | 19 K | + 19 K |
java.lang.Class | 37 | + 37 | 5772 b | + 5772 b |
java.util.HashMap$Entry | 6 | + 6 | 216 b | + 216 b |
java.lang.ClassNotFoundException | 5 | + 5 | 140 b | + 140 b |
java.security.CodeSource | 4 | + 4 | 112 b | + 112 b |
java.net.URL | 4 | + 4 | 272 b | + 272 b |
java.net.URLClassLoader$1 | 4 | + 4 | 112 b | + 112 b |
java.util.Vector | 3 | + 3 | 108 b | + 108 b |
java.security.ProtectionDomain | 2 | + 2 | 56 b | + 56 b |
java.lang.Thread | 2 | + 2 | 152 b | + 152 b |
sun.security.provider.PolicyPermissions | 2 | + 2 | 88 b | + 88 b |
sun.misc.URLClassPath$4 | 2 | + 2 | 72 b | + 72 b |
gwe.sql.gweMysqlDriver | 2 | + 2 | 40 b | + 40 b |
java.sql.DriverInfo | 2 | + 2 | 56 b | + 56 b |
java.lang.RuntimePermission | 2 | + 2 | 56 b | + 56 b |
java.io.FilePermission | 2 | + 2 | 88 b | + 88 b |
java.util.zip.ZipEntry | 2 | + 2 | 168 b | + 168 b |
java.util.zip.ZipFile$1 | 2 | + 2 | 120 b | + 120 b |
java.security.PrivilegedActionException | 2 | + 2 | 56 b | + 56 b |
java.lang.ThreadLocal | 2 | + 2 | 40 b | + 40 b |
sun.net.www.ParseUtil | 2 | + 2 | 40 b | + 40 b |
java.io.File | 2 | + 2 | 56 b | + 56 b |
java.util.jar.JarFile$JarFileEntry | 2 | + 2 | 184 b | + 184 b |
java.util.zip.ZipFile$ZipFileInputStream | 2 | + 2 | 88 b | + 88 b |
java.lang.ThreadLocal$SecureKey | 2 | + 2 | 40 b | + 40 b |
java.util.HashMap | 1 | + 1 | 60 b | + 60 b |
java.net.InetAddress$CacheEntry | 1 | + 1 | 36 b | + 36 b |
java.sql.SQLPermission | 1 | + 1 | 28 b | + 28 b |
java.io.FileInputStream | 1 | + 1 | 20 b | + 20 b |
java.security.AccessControlContext | 1 | + 1 | 36 b | + 36 b |
java.lang.Package | 1 | + 1 | 52 b | + 52 b |
java.net.InetAddress | 1 | + 1 | 28 b | + 28 b |
Connector/J 3.0.1 Beta |
Class name | Instance count | Difference | Size | Size difference |
---|---|---|---|---|
char[] | 708584 | + 708584 | 20572 K | + 20572 K |
Object[] | 355063 | + 355063 | 14525 K | + 14525 K |
java.lang.String | 263460 | + 263460 | 9262 K | + 9262 K |
byte[] | 258094 | + 258094 | 55689 K | + 55689 K |
sun.io.ByteToCharMS932 | 218000 | + 218000 | 14476 K | + 14476 K |
sun.io.ByteToCharJIS0201 | 218000 | + 218000 | 9367 K | + 9367 K |
java.util.Hashtable$Entry | 114008 | + 114008 | 4008 K | + 4008 K |
int[] | 111038 | + 111038 | 3096 K | + 3096 K |
java.lang.StringBuffer | 12106 | + 12106 | 331 K | + 331 K |
com.mysql.jdbc.Buffer | 12000 | + 12000 | 515 K | + 515 K |
java.util.HashMap$Entry | 8148 | + 8148 | 286 K | + 286 K |
sun.io.CharToByteMS932 | 4013 | + 4013 | 235 K | + 235 K |
sun.io.CharToByteJIS0201 | 4013 | + 4013 | 235 K | + 235 K |
java.lang.ref.Finalizer | 4001 | + 4001 | 140 K | + 140 K |
com.mysql.jdbc.Field | 4000 | + 4000 | 296 K | + 296 K |
com.mysql.jdbc.ResultSet | 3000 | + 3000 | 339 K | + 339 K |
java.util.ArrayList | 3000 | + 3000 | 82 K | + 82 K |
java.util.StringTokenizer | 2997 | + 2997 | 152 K | + 152 K |
java.util.HashMap | 2006 | + 2006 | 117 K | + 117 K |
java.lang.Integer | 2005 | + 2005 | 39 K | + 39 K |
com.mysql.jdbc.EscapeProcessor | 2000 | + 2000 | 39 K | + 39 K |
long[] | 2000 | + 2000 | 70 K | + 70 K |
com.mysql.jdbc.RowDataStatic | 2000 | + 2000 | 54 K | + 54 K |
com.mysql.jdbc.Statement | 2000 | + 2000 | 179 K | + 179 K |
java.lang.Object | 2000 | + 2000 | 39 K | + 39 K |
java.util.Properties | 2000 | + 2000 | 101 K | + 101 K |
java.io.FileDescriptor | 1001 | + 1001 | 19 K | + 19 K |
java.util.Hashtable | 1001 | + 1001 | 50 K | + 50 K |
sun.security.action.GetPropertyAction | 1000 | + 1000 | 27 K | + 27 K |
java.net.Socket$2 | 1000 | + 1000 | 19 K | + 19 K |
java.net.PlainSocketImpl | 1000 | + 1000 | 58 K | + 58 K |
java.io.BufferedInputStream | 1000 | + 1000 | 42 K | + 42 K |
java.lang.Boolean | 1000 | + 1000 | 19 K | + 19 K |
com.mysql.jdbc.MysqlIO | 1000 | + 1000 | 128 K | + 128 K |
java.io.BufferedOutputStream | 1000 | + 1000 | 27 K | + 27 K |
java.net.SocketInputStream | 1000 | + 1000 | 35 K | + 35 K |
com.mysql.jdbc.StandardSocketFactory | 1000 | + 1000 | 27 K | + 27 K |
java.net.Socket$1 | 1000 | + 1000 | 19 K | + 19 K |
java.net.Socket | 1000 | + 1000 | 19 K | + 19 K |
java.net.SocketOutputStream | 1000 | + 1000 | 27 K | + 27 K |
com.mysql.jdbc.Connection | 1000 | + 1000 | 191 K | + 191 K |
java.lang.Class | 70 | + 70 | 10 K | + 10 K |
java.lang.ClassNotFoundException | 25 | + 25 | 700 b | + 700 b |
java.net.URL | 24 | + 24 | 1632 b | + 1632 b |
java.net.URLClassLoader$1 | 24 | + 24 | 672 b | + 672 b |
com.mysql.jdbc.SingleByteCharsetConverter | 17 | + 17 | 340 b | + 340 b |
java.security.CodeSource | 14 | + 14 | 392 b | + 392 b |
java.util.jar.JarFile$JarFileEntry | 12 | + 12 | 1104 b | + 1104 b |
sun.net.www.ParseUtil | 12 | + 12 | 240 b | + 240 b |
java.util.zip.ZipEntry | 12 | + 12 | 1008 b | + 1008 b |
java.util.zip.ZipFile$1 | 12 | + 12 | 720 b | + 720 b |
java.io.File | 12 | + 12 | 336 b | + 336 b |
java.security.PrivilegedActionException | 12 | + 12 | 336 b | + 336 b |
sun.misc.URLClassPath$4 | 12 | + 12 | 432 b | + 432 b |
java.util.zip.ZipFile$ZipFileInputStream | 12 | + 12 | 528 b | + 528 b |
java.util.Vector | 3 | + 3 | 108 b | + 108 b |
java.lang.Thread | 2 | + 2 | 152 b | + 152 b |
java.io.FilePermission | 2 | + 2 | 88 b | + 88 b |
java.lang.RuntimePermission | 2 | + 2 | 56 b | + 56 b |
sun.security.provider.PolicyPermissions | 2 | + 2 | 88 b | + 88 b |
java.security.ProtectionDomain | 2 | + 2 | 56 b | + 56 b |
java.lang.ThreadLocal | 2 | + 2 | 40 b | + 40 b |
java.util.HashMap$1 | 2 | + 2 | 40 b | + 40 b |
java.lang.ref.SoftReference | 2 | + 2 | 72 b | + 72 b |
java.lang.ThreadLocal$SecureKey | 2 | + 2 | 40 b | + 40 b |
java.net.InetAddress$CacheEntry | 1 | + 1 | 36 b | + 36 b |
java.sql.SQLPermission | 1 | + 1 | 28 b | + 28 b |
java.io.FileInputStream | 1 | + 1 | 20 b | + 20 b |
java.net.InetAddress | 1 | + 1 | 28 b | + 28 b |
sun.security.action.GetIntegerAction | 1 | + 1 | 28 b | + 28 b |
sun.io.CharToByteISO8859_1 | 1 | + 1 | 44 b | + 44 b |
java.sql.DriverInfo | 1 | + 1 | 28 b | + 28 b |
java.security.AccessControlContext | 1 | + 1 | 36 b | + 36 b |
sun.io.ByteToCharCp437 | 1 | + 1 | 44 b | + 44 b |
java.lang.Package | 1 | + 1 | 52 b | + 52 b |
com.mysql.jdbc.Driver | 1 | + 1 | 20 b | + 20 b |