Re: RFC: Make new versions of pgjdbc Java8+

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Álvaro Hernández Tortosa <aht(at)8kdata(dot)com>
Cc: Daniel Migowski <dmigowski(at)ikoffice(dot)de>, John R Pierce <pierce(at)hogranch(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: RFC: Make new versions of pgjdbc Java8+
Date: 2017-04-03 18:49:02
Message-ID: CADK3HHLKSXaz8r7Xt__gvX2J_pOP3MzRsL38yD2jdh3oFpy4Wg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 3 April 2017 at 14:33, Álvaro Hernández Tortosa <aht(at)8kdata(dot)com> wrote:

>
>
> On 03/04/17 20:24, Daniel Migowski wrote:
>
> Hallo,
>
>
>
> in the name of performance, and that should be the main aspect for a
> database driver:
>
>
>
> · Don’t use lambdas! They are useful in a GUI where a few
> milliseconds are no problem, but shouldn’t IMHO be used on the server.
> Inner classes are slower to load but execute faster!
>
> · Don’t use streams when you can simply iterate over an array or
> a list. Unnecessary object creating just for the sake of readable code?
> Don’t do this in a database driver either!
>
> · Optionals: Why create objects for nothing? I’d rather have an
> if-check for null instead garbage on the heap.
>
>
> Thank you for your thoughts.
>
> I have heard these objections sometimes. I more or less agree with
> some of them. But don't want to fall into premature optimization: do you
> have some numbers to back these claims? If there would be performance
> drawbacks for using these, are they comparable to other performance hits in
> the driver?
>
> Regards,
>
> Álvaro
>
>
>
>
>
>
> Just my thoughts.
>
>
>
> Regards,
>
> Daniel Migowski
>
>
>
> *Von:* pgsql-jdbc-owner(at)postgresql(dot)org [mailto:pgsql-jdbc-owner@
> postgresql.org <pgsql-jdbc-owner(at)postgresql(dot)org>] *Im Auftrag von *Álvaro
> Hernández Tortosa
> *Gesendet:* Montag, 3. April 2017 13:36
> *An:* Dave Cramer <pg(at)fastcrypt(dot)com> <pg(at)fastcrypt(dot)com>
> *Cc:* John R Pierce <pierce(at)hogranch(dot)com> <pierce(at)hogranch(dot)com>; List
> <pgsql-jdbc(at)postgresql(dot)org> <pgsql-jdbc(at)postgresql(dot)org>
> *Betreff:* Re: [JDBC] RFC: Make new versions of pgjdbc Java8+
>
>
>
>
>
> On 03/04/17 13:05, Dave Cramer wrote:
>
>
>
> On 2 April 2017 at 19:03, Álvaro Hernández Tortosa <aht(at)8kdata(dot)com> wrote:
>
>
>
> On 03/04/17 00:56, John R Pierce wrote:
>
> On 4/2/2017 3:40 PM, Álvaro Hernández Tortosa wrote:
>
> - Java 6 EOLed 2/2013.
> - Java 7 EOLed 4/2015.
> - Java 8 was released 3 years ago, and brought significant improvements.
> - Java 9 will be (may be) released this year.
>
>
> isn't there a significant lag in version support by things like web
> services (j2ee, etc, as embedded in things like IBM WebSphere) ? j2ee 8
> isn't even out yet. Pretty sure a whole lot of that space is still stuck
> back in Java 6 land.
>
>
> Those are not related things. You can perfectly run J2EE 6 servers
> with Java 8 (and indeed, it is beneficial).
>
>
> Álvaro
>
> --
>
> Álvaro Hernández Tortosa
>
>
> -----------
> <8K>data
>
>
>
>
>
> Alvaro,
>
>
>
>
>
> So why do you want to write in java 8 ?
>
>
>
> Not a comprehensive or ordered list, but a few reasons:
>
> - JDK comes with Base64 and cryptographic functions like PBKDF2 that are
> needed for SCRAM. In Java6 you either implement yourself or pull external
> dependencies.
>
> - You can write conciser code (which improves significantly readability):
> * Lambas: anonymous classes. Callback-heavy code turns becomes
> readable.
> * Streams: unnecessary for loops and other goodies.
> * Optional: unnecessary ifs.
> * Since Java7: try-with-resources, 10_000 vs 10000 etc.
>
> - Reading Javadoc doesn't hurt my eyes ^_^
>
> - Time API, CompletableFuture.
>
> - Default and static methods in interfaces!
>
>
> Álvaro
>
>
> --
>
>
>
> Álvaro Hernández Tortosa
>
>
>
>
>
> -----------
>
> <8K>data
>
>
> --
>
> Álvaro Hernández Tortosa
>
>
> -----------
> <8K>data
>
>

Here are the D/L stats from jdbc.postgresql.org for this year

Quick eyeball of the latest two versions shows significant download of
jre6, and a scary data of 1208 jre7. I wonder what project is using that?

postgresql-42.0.0.jar: 39148
postgresql-42.0.0.jre7.jar: 7837
postgresql-42.0.0.jre6.jar: 16587

postgresql-9.4.1212.jar: 78122
postgresql-9.4.1212.jre7.jar: 71585
postgresql-9.4.1212.jre6.jar: 34292

postgresql-9.4.1211.jar: 17128
postgresql-9.4.1211.jre7.jar: 805
postgresql-9.4.1211.jre6.jar: 2315

postgresql-9.4.1210.jar: 11435
postgresql-9.4.1210.jre7.jar: 363
postgresql-9.4.1210.jre6.jar: 680

postgresql-9.4.1209.jar: 18020
postgresql-9.4.1209.jre7.jar: 881
postgresql-9.4.1209.jre6.jar: 1210

postgresql-9.4.1208.jar: 6886
postgresql-9.4.1208.jre7.jar: 100792
postgresql-9.4.1208.jre6.jar: 4793

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Álvaro Hernández Tortosa 2017-04-03 18:53:24 Re: RFC: Make new versions of pgjdbc Java8+
Previous Message Daniel Migowski 2017-04-03 18:47:51 Re: RFC: Make new versions of pgjdbc Java8+