Re: Why is JDBC so slow?

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Why is JDBC so slow?
Date: 2003-09-02 22:26:50
Message-ID: 20030902232650.G12948@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


On 02/09/2003 20:22 Tom Lane wrote:
> Fernando Nasser <fnasser(at)redhat(dot)com> writes:
> > So the psql program reads data and spits it out (to /dev/null, which is
> fast)
> > every row it reads.
>
> > The JDBC driver has to store all these rows in memory and wait for you
> > to tell it what you want to do with it.
>
> But libpq also stores the entire query result in memory. That doesn't
> seem like a reason for JDBC to be slower.

Speaking as Java programmer (as well a long-time C programmer), you'd be
amazed/shocked just how much memory a Java program can burn (take the
hidden malloc usage of (s/f)printf and magnify it a few orders of
magnitude). The problem with OO programmers is that they seem have even
less understanding of how computers work that even COBOL programmers do.
Basically, I think Joseph's test program does more to stress his
computer's memory management than it tests PostgreSQL. And I think most
people on this list realize that JDBC will always be slower than a C
and/or assembler interface. That said and speaking as a Java/web
developer, I find the PostgreSQL JDBC to be fast enough for real life
applications.

regards

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2003-09-02 22:35:42 Re: Why is JDBC so slow?
Previous Message Oliver Jowett 2003-09-02 21:59:51 Re: Why is JDBC so slow?