Debugging Derby 10.2.1.6 applications with Eclipse 3.1.2 is 10 times slower
than debugging 10.1.2.2 applications
----------------------------------------------------------------------------------------------------------------
Key: DERBY-2148
URL: http://issues.apache.org/jira/browse/DERBY-2148
Project: Derby
Issue Type: Sub-task
Components: Performance
Affects Versions: 10.2.1.6
Environment: Windows XP, Eclipse 3.1.2 and 3.2.1, Derby 10.2.1.6 and
10.1.2.2, JDK 1.4.2_10
Reporter: Stefan Cordes
Priority: Minor
When running an db-application with Derby 10.2 and eclipse 3.1.2 the CPU usage
of the eclipse javaw consumes the major CPU power and so the application is
slow.
Workaround: Take Eclipse 3.2.1 (where Derby 10.2 "debugs" only 50% slower)
The below code gives following results:
Runing mode:
Eclipse 3.1 with Derby 10.1: Inserts=8.000ms
Eclipse 3.1 with Derby 10.2: Inserts=6.000ms
Eclipse 3.2 with Derby 10.1: Inserts=6.000ms
Eclipse 3.2 with Derby 10.2: Inserts=6.000ms
(everything fine)
BUT Debugging mode:
Eclipse 3.1 with Derby 10.1: Inserts=20.000ms
Eclipse 3.1 with Derby 10.2: Inserts=229.000ms (<<<<)
Eclipse 3.2 with Derby 10.1: Inserts=20.000ms
Eclipse 3.2 with Derby 10.2: Inserts=30.000ms
Any known reason for that?
{code}
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import org.apache.derby.jdbc.EmbeddedDriver;
/**
* Test Speed on Derby Inserts
*
*/
public class SlowDerbyDebugTest {
public static void main(String[] args) {
try {
deleteFiles(new File("DB4O4"));
System.out.println("Classpath=" +
System.getProperty("java.class.path"));
DriverManager.registerDriver(new EmbeddedDriver());
Connection tempConnection =
DriverManager.getConnection("jdbc:derby:DB4O4;create=true");
tempConnection.setAutoCommit(false);
Statement tempStatement =
tempConnection.createStatement();
long tempStart = System.currentTimeMillis();
tempStatement.executeUpdate("create table test (id
bigint, value char(40), primary key(id))");
long tempStop1 = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
tempStatement.executeUpdate("insert into test
values (" + i + ",'" + i + "')");
}
long tempStop2 = System.currentTimeMillis();
tempConnection.commit();
long tempStop3 = System.currentTimeMillis();
System.out.println("Create Table=" + (tempStop1 -
tempStart) + "ms Inserts=" + (tempStop2 - tempStop1) + "ms"
+ " commit=" + (tempStop3 - tempStop2)
+ "ms Total=" + (tempStop3 - tempStart) + "ms");
tempConnection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
private static void deleteFiles(File tempDir) {
String[] tempFileNames = tempDir.list();
if (tempFileNames != null) {
for (int i = 0; i < tempFileNames.length; i++) {
File tempDbFile = new
File(tempDir.getAbsolutePath() + "/" + tempFileNames[i]);
if (tempDbFile.isDirectory()) {
deleteFiles(tempDbFile);
tempDbFile.delete();
} else {
if (!tempDbFile.delete()) {
throw new
RuntimeException("Cannot delete DB file '" + tempDbFile + "'.");
}
}
}
tempDir.delete();
}
}
}
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira