Subject Re: [Firebird-Java] Driver Speed Tests
Author Richard Bair
I also performed some speed tests on select statements. I found that the
slowdown was in the GDS_Impl class. When it was creating the XSQLVar
objects (I think it was), it was creating a new String(byte[], int, int) I
believe. A profilier showed that the driver was in this Constructor 68% of
the time. I was working on testing some other approaches, but I've not had
the time to finish (sorry bout that Roman)





>From: Carsten Sch�fer <ca_schaefer@...>
>Reply-To: Firebird-Java@yahoogroups.com
>To: <Firebird-Java@yahoogroups.com>
>Subject: Re: [Firebird-Java] Driver Speed Tests
>Date: Wed, 16 Oct 2002 10:38:22 +0200
>
>Hi,
>the tests was done with Win2000 SP3 on Intel 600Mhz, Sun JDK1.3.1_05.
>I can give you the exact times later.
>
>gru�
>Carsten
> ----- Original Message -----
> From: Blas Rodriguez Somoza
> To: Firebird-Java@yahoogroups.com
> Sent: Wednesday, October 16, 2002 10:07 AM
> Subject: Re: [Firebird-Java] Driver Speed Tests
>
>
> Hello
>
> Thanks for the code, I'll try to investigate that this week.
>
> There are some information that can help me when evaluating the
>problem.
>
> 1.- Which JDK are you using?. Because our driver is pure Java, with
>newer JDK's the performance enhancement is greater than in Interclient.
>
> 2.- Can you give me the test time for Interclient and Jaybird?.
>
> Regards
> Blas Rodriguez Somoza
> ----- Original Message -----
> From: Carsten Sch�fer
> To: Java-Firebird
> Sent: Monday, October 14, 2002 4:58 PM
> Subject: [Firebird-Java] Driver Speed Tests
>
>
> Hi
> I've written a little test class to test the perfomance difference
>between Jaybird and Interclient with varchars with character set WIN1252.
>
> This is my db structure:
> CREATE DATABASE 'd:\DBTEST.GDB'
> USER 'sysdba' PASSWORD 'masterkey'
> PAGE_SIZE 4096;
> CREATE TABLE T_TEST1 (
> F_TEST1 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST2 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST3 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST4 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST5 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST6 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST7 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST8 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST9 VARCHAR(250) CHARACTER SET WIN1252,
> F_TEST10 VARCHAR(250) CHARACTER SET WIN1252
> );
>
> And this is my test class:
>
> import interbase.interclient.CharacterEncodings;
>
> import java.sql.*;
> import java.util.Properties;
>
> public class DBTEST {
> public static final void dbtest(boolean interclient) {
> try {
> Properties dbProperties = new Properties();
> dbProperties.put("user","sysdba" );
> dbProperties.put("password", "masterkey");
> dbProperties.put("charSet",CharacterEncodings.Cp1252);
> dbProperties.put("lc_ctype", "WIN1252");
> Connection con = null;
> if (interclient) {
> Class.forName("interbase.interclient.Driver");
> con =
>DriverManager.getConnection("jdbc:interbase://localhost/d:/dbtest.gdb",
>dbProperties);
> } else {
> Class.forName("org.firebirdsql.jdbc.FBDriver");
> con =
>DriverManager.getConnection("jdbc:firebirdsql://localhost/d:/dbtest.gdb",
>dbProperties);
> }
> long start = System.currentTimeMillis();
> PreparedStatement insert = con.prepareStatement("insert
>into t_test1 values (?,?,?,?,?,?,?,?,?,?)");
> for (int i= 1;i<=20000;i++) {
> insert.setString(1,
>"�lkkkdsklsda�d0590945650096945�945�46�sakldsalk9034298428
>45290904528420z5928dfldsf"+i);
> insert.setString(2,
>"iowerw8290nvdshdskljkfduiuj-xyc����pf3490384jhkffkhdfjgfdhfhdhfh92�" + i);
> insert.setString(3,
>"dsahjdsalkas�3qp�p3410p4319p341jjludiouaidjilja" + i);
> insert.setString(4, "hkdsuuzhdsauidsazhs" + i);
> insert.setString(5,
>"cx,mkja�3420990320984390843kjghjghjf��" + i);
> insert.setString(6,
>"sdkhkjdsau98712098912pk<�#dsa�aasd���as������sa" + i);
> insert.setString(7,
>"sajkhjasiu7wq987e902�0pjxycj9fgklgjkgfjkjkdkjldfjkgfjkfdkjfdkjkjgfkjldkjdfkljqei8�oe��lp"
>+ i);
> insert.setString(8,
>"cx.,cxc��0p�q0��q0�ew90idlkdsl�kiao�diaopdoix�yc�+yxcxp�+y" + i);
> insert.setString(9,
>"12309912031�13820818308108091238901�830183208129�028128hcxkh" + i);
> insert.setString(10,
>"cxklkxyhjsclisauuduiouduosuisauasiu128790132909871239891213209189" + i);
> insert.executeUpdate();
> }
> insert.close();
> long ende = System.currentTimeMillis();
> System.out.println("Time for insert into
>test1:"+((ende-start)) );
> Statement select = con.createStatement();
> ResultSet rs = select.executeQuery("select * from
>t_test1");
> while (rs.next()) {
> String s1 = rs.getString("f_test1");
> String s2 = rs.getString("f_test2");
> String s3 = rs.getString("f_test3");
> String s4 = rs.getString("f_test4");
> String s5 = rs.getString("f_test5");
> String s6 = rs.getString("f_test6");
> String s7 = rs.getString("f_test7");
> String s8 = rs.getString("f_test8");
> String s9 = rs.getString("f_test9");
> String s10 = rs.getString("f_test10");
> }
> rs.close();
> select.close();
> long ende2 = System.currentTimeMillis();
> System.out.println("Time for select from test1:" + ((ende2
>- ende)));
> con.close();
> } catch (ClassNotFoundException e) {
> System.err.println("Error:" + e.getMessage());
> e.printStackTrace();
> } catch (SQLException e2) {
> System.err.println("Error:"+e2.getMessage());
> e2.printStackTrace();
> }
> }
>
>
> public static void main(String[] args) {
> DBTEST.dbtest(false);
>
> }
> }
>
> With inserts Jaybird is about 30-35% slower than Interclient and with
>Selects it's 70-75%.
> Any comments ?
>
> gru�
> carsten Sch�fer
>
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


_________________________________________________________________
Internet access plans that fit your lifestyle -- join MSN.
http://resourcecenter.msn.com/access/plans/default.asp