gweMysql Driver  vs  MM.MYSQL Driver
 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?characterEncoding=Shift_JIS";
      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]);
      for(int i = 0; i < 1000; i++)
        test();
    }
    catch( Exception e ) {
      e.printStackTrace();
    }
  }
}

Environment
Profiler Borland Optimizeit Profiler
Java VM Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)
OS Windows2000 SP2
CPU PentiumIII 700MHz
Memory 256MB
RDBMS MySQL-Max 3.23.49a
Table definition & data create table foo(col1 INTEGER PRIMARY KEY, col2 VARCHAR(128) NOT NULL);

INSERT INTO foo values(1, '');

gwe.sql.MysqlDriver 2002/05/26
Class name Instance count Difference Size Size difference
int[]   445 + 445 79 K + 79 K
char[]   401 + 401 27 K + 27 K
byte[]   346 + 346 656 K + 656 K
java.lang.String   296 + 296 11 K + 11 K
Object[]   145 + 145 10 K + 10 K
java.util.Hashtable$Entry   79 + 79 3160 b + 3160 b
java.lang.StringBuffer   51 + 51 2040 b + 2040 b
short[]   41 + 41 3520 b + 3520 b
java.lang.Integer   39 + 39 1248 b + 1248 b
java.lang.Class   37 + 37 1480 b + 1480 b
gwe.sql.gweMysqlStringBuffer   35 + 35 1120 b + 1120 b
java.lang.ref.Finalizer   30 + 30 1440 b + 1440 b
java.util.Hashtable   25 + 25 1400 b + 1400 b
java.lang.ref.SoftReference   21 + 21 1008 b + 1008 b
java.util.ArrayList   10 + 10 400 b + 400 b
java.io.FileDescriptor   10 + 10 320 b + 320 b
java.net.SocketOutputStream   10 + 10 400 b + 400 b
java.net.PlainSocketImpl   10 + 10 720 b + 720 b
java.util.Properties   10 + 10 640 b + 640 b
gwe.sql.gweMysqlColumn   10 + 10 480 b + 480 b
sun.io.CharToByteMS932   10 + 10 640 b + 640 b
sun.io.CharToByteJIS0201   10 + 10 720 b + 720 b
java.net.SocketInputStream   10 + 10 400 b + 400 b
java.lang.Object   10 + 10 240 b + 240 b
java.util.Hashtable$Enumerator   9 + 9 504 b + 504 b
sun.io.ByteToCharMS932   9 + 9 720 b + 720 b
sun.io.ByteToCharJIS0201   9 + 9 432 b + 432 b
java.util.HashMap$Entry   6 + 6 240 b + 240 b
gwe.sql.gweMysqlResultSetCore   5 + 5 360 b + 360 b
gwe.sql.gweMysql   5 + 5 560 b + 560 b
java.io.DataInputStream   5 + 5 160 b + 160 b
java.io.DataOutputStream   5 + 5 160 b + 160 b
gwe.sql.gweMysqlMetaResult   5 + 5 160 b + 160 b
gwe.sql.gweMysqlResultSetBuffer   5 + 5 200 b + 200 b
gwe.sql.gweMysqlPacket   5 + 5 360 b + 360 b
java.net.Socket   5 + 5 160 b + 160 b
gwe.sql.gweMysqlConnection   5 + 5 400 b + 400 b
gwe.sql.gweMysqlStatement   5 + 5 320 b + 320 b
java.net.Socket$1   4 + 4 128 b + 128 b
java.net.Socket$2   4 + 4 128 b + 128 b
sun.security.action.GetPropertyAction   4 + 4 128 b + 128 b
java.util.Vector   3 + 3 120 b + 120 b
java.io.FilePermission   2 + 2 96 b + 96 b
java.security.ProtectionDomain   2 + 2 64 b + 64 b
java.lang.Thread   2 + 2 160 b + 160 b
java.lang.RuntimePermission   2 + 2 80 b + 80 b
java.lang.ThreadLocal   2 + 2 64 b + 64 b
java.security.CodeSource   2 + 2 80 b + 80 b
java.lang.ThreadLocal$SecureKey   2 + 2 64 b + 64 b
sun.security.provider.PolicyPermissions   2 + 2 96 b + 96 b
java.security.AccessControlContext   2 + 2 80 b + 80 b
java.sql.SQLPermission   1 + 1 40 b + 40 b
java.sql.DriverInfo   1 + 1 40 b + 40 b
java.net.InetAddress$CacheEntry   1 + 1 40 b + 40 b
gwe.sql.gweMysqlDriver   1 + 1 24 b + 24 b
java.lang.Package   1 + 1 56 b + 56 b
java.net.InetAddress   1 + 1 40 b + 40 b
java.util.HashMap   1 + 1 64 b + 64 b



org.gjt.mm.mysql.Driver  Version 2.0.14
Class name Instance count Difference Size Size difference
char[]   4648 + 4648 210 K + 210 K
java.lang.String   2681 + 2681 104 K + 104 K
Object[]   1582 + 1582 88 K + 88 K
java.util.Hashtable$Entry   1273 + 1273 49 K + 49 K
byte[]   1058 + 1058 180 K + 180 K
sun.io.ByteToCharMS932   964 + 964 75 K + 75 K
sun.io.ByteToCharJIS0201   964 + 964 45 K + 45 K
int[]   867 + 867 96 K + 96 K
org.gjt.mm.mysql.Buffer   60 + 60 2880 b + 2880 b
java.lang.StringBuffer   49 + 49 1960 b + 1960 b
short[]   43 + 43 4224 b + 4224 b
java.lang.Class   40 + 40 1600 b + 1600 b
java.lang.ref.Finalizer   40 + 40 1920 b + 1920 b
java.util.Hashtable   27 + 27 1512 b + 1512 b
java.lang.Integer   20 + 20 640 b + 640 b
org.gjt.mm.mysql.Field   16 + 16 896 b + 896 b
java.util.Vector   11 + 11 440 b + 440 b
java.net.PlainSocketImpl   10 + 10 720 b + 720 b
java.net.SocketInputStream   10 + 10 400 b + 400 b
java.net.SocketOutputStream   10 + 10 400 b + 400 b
org.gjt.mm.mysql.jdbc2.Connection   10 + 10 1600 b + 1600 b
java.lang.Object   10 + 10 240 b + 240 b
java.io.FileDescriptor   10 + 10 320 b + 320 b
java.util.StringTokenizer   9 + 9 504 b + 504 b
org.gjt.mm.mysql.jdbc2.Statement   8 + 8 768 b + 768 b
long[]   8 + 8 384 b + 384 b
org.gjt.mm.mysql.EscapeProcessor   8 + 8 192 b + 192 b
org.gjt.mm.mysql.jdbc2.ResultSet   8 + 8 1280 b + 1280 b
java.util.Properties   8 + 8 512 b + 512 b
java.util.HashMap$Entry   5 + 5 200 b + 200 b
java.io.BufferedOutputStream   4 + 4 160 b + 160 b
java.net.Socket$2   4 + 4 128 b + 128 b
java.io.BufferedInputStream   4 + 4 192 b + 192 b
java.net.Socket   4 + 4 128 b + 128 b
org.gjt.mm.mysql.jdbc2.IO   4 + 4 416 b + 416 b
java.lang.Boolean   3 + 3 96 b + 96 b
java.net.Socket$1   3 + 3 96 b + 96 b
sun.security.action.GetPropertyAction   3 + 3 96 b + 96 b
java.lang.Package   2 + 2 112 b + 112 b
java.security.ProtectionDomain   2 + 2 64 b + 64 b
java.lang.RuntimePermission   2 + 2 80 b + 80 b
java.security.CodeSource   2 + 2 80 b + 80 b
java.lang.Thread   2 + 2 160 b + 160 b
sun.security.provider.PolicyPermissions   2 + 2 96 b + 96 b
java.security.AccessControlContext   2 + 2 80 b + 80 b
java.io.FilePermission   2 + 2 96 b + 96 b
java.net.InetAddress$CacheEntry   1 + 1 40 b + 40 b
java.net.InetAddress   1 + 1 40 b + 40 b
java.sql.DriverInfo   1 + 1 40 b + 40 b
java.sql.SQLPermission   1 + 1 40 b + 40 b
org.gjt.mm.mysql.Driver   1 + 1 24 b + 24 b