Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A96D19FB434 for ; Fri, 6 Oct 2006 16:34:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 12119-06 for ; Fri, 6 Oct 2006 16:34:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id D6B059FB45A for ; Fri, 6 Oct 2006 16:21:28 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.evolute.pt (www.evolute.pt [81.92.208.25]) by svr4.postgresql.org (Postfix) with ESMTP id C22B65AF9AB for ; Fri, 6 Oct 2006 19:21:27 +0000 (GMT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.evolute.pt (8.13.8/8.12.11) with ESMTP id k96JLEMw010375 for ; Fri, 6 Oct 2006 20:21:14 +0100 Message-ID: <4526AC9F.2010508@evolute.pt> Date: Fri, 06 Oct 2006 20:21:03 +0100 From: Luis Vilar Flores User-Agent: Thunderbird 1.5.0.7 (X11/20060913) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: bytea memory improvement - test results References: <44EB8C82.1000203@evolute.pt> <45192600.5050704@kyon.de> <451948B4.1060309@evolute.pt> In-Reply-To: <451948B4.1060309@evolute.pt> Content-Type: multipart/mixed; boundary="------------060107010903090506080503" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/43 X-Sequence-Number: 15926 This is a multi-part message in MIME format. --------------060107010903090506080503 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------060107010903090506080503 Content-Type: text/x-java; name="ByteaTest2.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ByteaTest2.java" 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" ); } } } --------------060107010903090506080503--