Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv6mz-0000ET-Oc for pgsql-jdbc@arkaria.postgresql.org; Mon, 03 Apr 2017 18:33:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cv6mz-0005iZ-BE for pgsql-jdbc@arkaria.postgresql.org; Mon, 03 Apr 2017 18:33:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cv6my-0005i7-HP for pgsql-jdbc@postgresql.org; Mon, 03 Apr 2017 18:33:16 +0000 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cv6mw-000647-1X for pgsql-jdbc@postgresql.org; Mon, 03 Apr 2017 18:33:16 +0000 Received: by mail-wr0-x22f.google.com with SMTP id t20so2465222wra.1 for ; Mon, 03 Apr 2017 11:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=8kdata-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=5pf1TcGyaJzK3O02mtqZV6PuN+oSKJO6NHc1H/jZUAU=; b=b31ekoIeIOvFq0BTWddO0FG29ICBwtTenVhXbOPVPfvWesUMlyKVo2GoIJvQAE/Q65 /QK3UTsLX41UeP2q+wBdWm7uyiNiEjaZT3+41158rRWsqlZoRDYfm22y3E7TvCcLqCVu QapVJ++gnDHfZBF11NASeOB/sKZ1lAwtH3KZuJHiUl7ARwKfzev5y/H235PE1dhf61Gd R8MrARnHdXHcWxeDxYOXrElntJB2NRJe1+Kiv+jE9TqL2j9UgKf5Vk1BqiOBjdTa7tCT HkhOJpUR3yBy6uooPnLBESPwVbku8sM7glwwdjbOvLKrw/CX1ViZ6+z87P1acYLsEYw7 zdXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=5pf1TcGyaJzK3O02mtqZV6PuN+oSKJO6NHc1H/jZUAU=; b=O6TAPEqOkMyBgUtYqWCnwm9ohXLmtbwjJy2PpcWyDCQPTqbDd87KZjlUTpCorsCjrV k+CYeefsto3P+7Og8ZGDjWdWmzJFO1skouBsCnXghWGW6azpCqUJxwHEreQNuNI3QJKf KnCM0mwm0MqzX2ssN+M01J2PJWIz2ecBcyS9flHlT/xq38M8hMMbBiE/mL4Zhy7MtOUZ 4Y68oPhqXclYuqjcbzraFOBUA1g2YHLIamNznthyu6SCpWam2WNCuODwGIPGMg6Vw32J deI0plUe+qAc4vDcR9t/FDMbsEEyhI8DIfMRGi+7bJCOMw3D3T/lQy9Uj8AHTCH5mmdZ WBVw== X-Gm-Message-State: AFeK/H3575sI6ko9ZR7Li8hsSwyToqv9cNTN90B5v/XfUS2o1lsjvZ18p7noCcTzjsJrHg== X-Received: by 10.223.152.43 with SMTP id v40mr16031761wrb.60.1491244393011; Mon, 03 Apr 2017 11:33:13 -0700 (PDT) Received: from [10.0.10.100] (111.red-88-3-36.dynamicip.rima-tde.net. [88.3.36.111]) by smtp.gmail.com with ESMTPSA id o196sm15369437wmg.12.2017.04.03.11.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 11:33:12 -0700 (PDT) Subject: Re: RFC: Make new versions of pgjdbc Java8+ To: Daniel Migowski , Dave Cramer References: <393118b3-4373-3e27-6f7e-0a7f764c9c81@8kdata.com> <9289bc74-5c08-c180-3a7a-943c79230824@8kdata.com> <41ED3F5450C90F4D8381BC4D8DF6BBDCAF6CA67F@EXCHANGESERVER.ikoffice.de> Cc: John R Pierce , List From: =?UTF-8?Q?=c3=81lvaro_Hern=c3=a1ndez_Tortosa?= Message-ID: <5989a0cc-8318-28a7-9389-b284f42f671c@8kdata.com> Date: Mon, 3 Apr 2017 20:33:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <41ED3F5450C90F4D8381BC4D8DF6BBDCAF6CA67F@EXCHANGESERVER.ikoffice.de> Content-Type: multipart/alternative; boundary="------------DF6D30C2BB91A8AB4F6822E3" X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------DF6D30C2BB91A8AB4F6822E3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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@postgresql.org > [mailto:pgsql-jdbc-owner@postgresql.org] *Im Auftrag von *Álvaro > Hernández Tortosa > *Gesendet:* Montag, 3. April 2017 13:36 > *An:* Dave Cramer > *Cc:* John R Pierce ; List > > *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 > 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 --------------DF6D30C2BB91A8AB4F6822E3 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

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@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] Im Auftrag von Álvaro Hernández Tortosa
Gesendet: Montag, 3. April 2017 13:36
An: Dave Cramer <pg@fastcrypt.com>
Cc: John R Pierce <pierce@hogranch.com>; List <pgsql-jdbc@postgresql.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@8kdata.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
--------------DF6D30C2BB91A8AB4F6822E3--