mysql strange performance - java strange performance

mysql strange performance - java strange performance

Post by p.klei » Sat, 31 Jul 2004 18:16:43


i.

The reason of low performance was that I used out-of-date JRE (j2sdk1.4.1_03). Here come results for: j2sdk1.4.1_03 and j2sdk1.4.2_04. I felt deeply estonished when I saw these results.

j2sdk1.4.1_03

[start]
method2 (0.15s).
method1 (10.409s).
method2 (0.031s).
method1 (9.398s).
[end]

j2sdk1.4.2_04

[start]
method2 (0.147s).
method1 (0.119s).
method2 (0.035s).
method1 (0.066s).
[end]

And the test source code:

--------------------------------------------------------------------------------------------------------------
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/*
* Created on 2004-07-29
*/


/*
CREATE TABLE `test` (
`fInt` int(11) default NULL,
`fDouble` double default NULL,
`fText` text
) TYPE=MyISAM
**/

/**
* @author prep
*
* TODO JavaDoc
*/
public class test {

private static final int TEST_ROWS = 5000;

private static final String FN_INT = "fInt";

private static final String FN_DOUBLE = "fDouble";

private static final String FN_TEXT = "fText";

/**
* Retriving data using ResultSet.getDouble(...).
*
* @param rs
* ResultSet.
* @throws NumberFormatException
* @throws SQLException
*/
private static void method1(ResultSet rs) throws NumberFormatException, SQLException {
Runtime.getRuntime().gc();
long startTime = System.currentTimeMillis();
while (rs.next()) {
rs.getInt(FN_INT);
rs.getDouble(FN_DOUBLE);
rs.getString(FN_TEXT);
}
long endTime = System.currentTimeMillis();
System.out.println("method1 (" + ((double) (endTime - startTime) / 1000) + "s).");
}

/**
* Retriving data using Double.parseDouble(ResultSet.getString(...)).
*
* @param rs
* ResultSet.
* @throws NumberFormatException
* @throws SQLException
*/
private static void method2(ResultSet rs) throws NumberFormatException, SQLException {
Runtime.getRuntime().gc();
long startTime = System.currentTimeMillis();
while (rs.next()) {
rs.getInt(FN_INT);
Double.parseDouble(rs.getString(FN_DOUBLE));
rs.getString(FN_TEXT);
}
long endTime = System.currentTimeMillis();
System.out.println("method2 (" + ((double) (endTime - startTime) / 1000) + "s).");
}

/**
* Populating table with given number of rows.
*
* @param conn
* Database connection.
* @param rowsToPopulate
* @throws SQLException
*/
private static void populate(Connection conn, int rowsToPopulate) throws SQLException {
long startPopulate = System.currentTimeMillis();
Statement stmt = conn.createStatement();
for (int i = 0; i < rowsToPopulate; i++)
stmt.execute("insert into test values (1,0.1, 'abcdefghijklmnopqrstuwvxz')");
long endPopulate = System.currentTimeMillis();
System.out.println("populate " + rowsToPopulate + " rows (" + ((double) (endPopulate - startPopulate) / 1000)
+ "s).");
}

/**
* Deletes table contents (used when decreasing number of records in test).
*
* @param conn
* Database connection.
* @throws SQLExcepti
 
 
 

1. Strange Performance Counter performance problem in Windows Service application

2. Strange issue with NDISPROT xmit and network the performance counter

Hi All,

I found a strange behavior of my custom NDISPROT-based driver for
sending/receiving RAW Ethernet packets.

When my driver's client send/receive Ethernet packets, the transmitted data
is not counted in the TaskManager/Network graph.
While transmit throughput is about 50MB/s the network load is shown as near
zero point.

The received data is counted without problems.

All the traffic sent/received with TCP/IP is shown OK.

So I suspect my NDIS protocol does something wrong (or does not do
something) that leads to the strange issue with the network performance
counters?

Any help or suggestions are highly appreciated.

Best regards,
Valeriy Glushkov

3. strange performance behaviour for memcpy in 64 bit app

4. Performance monitoring: strange error in .Net 2.0

5. .NET remoting strange performance problem

6. strange information from asp.net trace / getting performance information using WebRequest and StreamReader

7. Strange performance problems..

8. Jetstress performance strange results...

9. Strange performance issues

10. Strange performance drop in Vista

11. strange view performance....

12. strange performance with vsync

13. Strange difference in performance (30x) between PPC and Intel

14. Strange issue with NDISPROT xmit and the network performance counter

15. Strange performance behavior with two VMR9 Mixing Renderer Allocat