Re: bytea memory improvement - test results
От | Luis Vilar Flores |
---|---|
Тема | Re: bytea memory improvement - test results |
Дата | |
Msg-id | 4526AC9F.2010508@evolute.pt обсуждение исходный текст |
Ответ на | Re: bytea memory improvement (Luis Vilar Flores <lflores@evolute.pt>) |
Список | pgsql-jdbc |
Hello, These are the results from the Kris Jurka's ByteaTest2.java. If there are more questions or someone want something else about this patch just ask it... I look forward to see a new driver with this patch ... CeleronM@1.6 1MB L2 cache Fedora Core 5 jdk1.5.0_08 local db ver 8.1.4 jdbc driver ver 407 OLD Time: 56261ms Mem: 2760776b Time: 56077ms Mem: 2753088b Time: 56181ms Mem: 2753088b Time: 56184ms Mem: 2753088b Time: 56259ms Mem: 2753088b NEW Time: 34603ms Mem: 1859656b Time: 34438ms Mem: 1852776b Time: 34409ms Mem: 1852776b Time: 34610ms Mem: 1852776b Time: 34496ms Mem: 1852776b G5@1.8 512KB L2 cache Mac OS X 10.4.8 jdk1.5.0_06 remote db ver 8.1.4(on LAN) jdbc driver ver 407 OLD Time: 130390ms Mem: 2812064b Time: 131060ms Mem: 2811776b Time: 131039ms Mem: 2811776b Time: 131627ms Mem: 2811776b Time: 131772ms Mem: 2811776b NEW Time: 83940ms Mem: 1911752b Time: 83244ms Mem: 1911464b Time: 83350ms Mem: 1911464b Time: 83457ms Mem: 1911464b Time: 83610ms Mem: 1911464b import java.sql.*; public class ByteaTest2 { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/test_bytea","postgres",""); for (int k=0; k<5; k++) { long t1 = System.currentTimeMillis(); long total = 0; for (int j=0; j<10; j++) { PreparedStatement pstmt = conn.prepareStatement("SELECT varcharsend(repeat(?,?))"); pstmt.setString(1, "a\\001"); pstmt.setInt(2, 150000); ResultSet rs = pstmt.executeQuery(); rs.next(); for (int i=0; i<100; i++) { byte b[] = rs.getBytes(1); total += b.length; } rs.close(); pstmt.close(); } long t2 = System.currentTimeMillis(); long usedMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); System.out.println("Time: " + ( t2-t1 ) + "ms Mem: " + usedMem + "b" ); } } }
В списке pgsql-jdbc по дате отправления: