From: Álvaro Hernández Tortosa <aht@8kdata.com>
To: rado@edno.moe
Cc: Daniel Migowski <dmigowski@ikoffice.de>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: John R Pierce <pierce@hogranch.com>
Cc: List <pgsql-jdbc@postgresql.org>
Cc: pgsql-jdbc-owner@postgresql.org
Subject: Re: RFC: Make new versions of pgjdbc Java8+
Date: Mon, 3 Apr 2017 21:42:43 +0200
Message-ID: <971a86da-3576-1a1d-e80a-40038bf9793b@8kdata.com> (raw)
In-Reply-To: <10139f8589debc46122b31ecf3720626@edno.moe>
References: <393118b3-4373-3e27-6f7e-0a7f764c9c81@8kdata.com>
<dab17d70-29b7-9445-ab0a-98a502318f0a@hogranch.com>
<c98f5172-bc5f-5987-a2c6-03766547469a@8kdata.com>
<CADK3HHKyRxDKGcagk9ooqjCL=DHnieE_rp2MLTnpCpTUOn9p+A@mail.gmail.com>
<9289bc74-5c08-c180-3a7a-943c79230824@8kdata.com>
<41ED3F5450C90F4D8381BC4D8DF6BBDCAF6CA67F@EXCHANGESERVER.ikoffice.de>
<5989a0cc-8318-28a7-9389-b284f42f671c@8kdata.com>
<41ED3F5450C90F4D8381BC4D8DF6BBDCAF6CA6F3@EXCHANGESERVER.ikoffice.de>
<58330587-d79c-78e0-b239-2db7c59cecef@8kdata.com>
<10139f8589debc46122b31ecf3720626@edno.moe>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On 03/04/17 21:34, rado@edno.moe wrote:
> Hello Alvaro,
>
> On 2017-04-03 21:53, Álvaro Hernández Tortosa wrote:
>> On 03/04/17 20:47, Daniel Migowski wrote:
>>
>>> Hello Alvaro,
>>>
>>> while the biggest performance hit currently in the driver is the
>>> switch to java.util.Logging (i will come up with numbers regarding
>>> that in a few days, comparing it to previous versions). Currently,
>>> and comparing to the 9.3 driver with the current driver, the
>>> Hibernate databases checks take twice the time than before! Even if
>>> some parts have improved (see changes in PGStream and
>>> VisibleBufferedInputStream, nice reuse of arrays there since 9.3)
>>> other things have changed to the bad.
>>>
>>> I also already did my tests regarding the stuff below, and concluded
>>> that in our company lambda’s are useful in the GUI, but as I said
>>> shouldn’t be used on the server. In my tests they were about 50%
>>> percent slower in the long run.
>>>
>>> Streams are the same thing… just look at the stack traces! Good
>>> for rarely used stuff, but honestly I prefer a nice loop where you
>>> see what is happening in terms of object creation over streams that
>>> might be concise, but are not needed. At least not for something you
>>> call potentially 100ths of times a second.
>>
>> While I agree Lambdas and Streams should be used with care, I'm
>> still unconvinced that they really take a hit in performance (if the
>> compiler is not optimizing that, which most of the time does). I would
>> really love to see some numbers to prove my wrong in this respect. But
>> I don't see much trends towards not using them in the Java world (but
>> the contrary) and I talk to very performance conscious people.
>
> I've remembered about this writing:
> http://blog.takipi.com/benchmark-how-java-8-lambdas-and-streams-can-make-your-code-5-times-slower/
>
> They have the code available, I haven't verified it personally. Also
> it is possible the outcome to be different with the newer releases of
> the JDK. Please note the difference between the original results and
> the updated ones.
>
> The base line is: you have to be extra careful with the streams,
> autoboxing and to avoid using lamdas in "hot" places. At least for the
> tested use case - "sorting ArrayList populated with 100 000 random
> integers".
Yeah, that's exactly what I meant: they should be used with care.
But that is quite different from never using them at all :)
Thank you for the link, I read that in the past and is a good example.
Cheers,
Álvaro
--
Álvaro Hernández Tortosa
-----------
<8K>data
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: aht@8kdata.com, rado@edno.moe, dmigowski@ikoffice.de, pg@fastcrypt.com, pierce@hogranch.com, pgsql-jdbc-owner@postgresql.org
Subject: Re: RFC: Make new versions of pgjdbc Java8+
In-Reply-To: <971a86da-3576-1a1d-e80a-40038bf9793b@8kdata.com>
References: <393118b3-4373-3e27-6f7e-0a7f764c9c81@8kdata.com> <dab17d70-29b7-9445-ab0a-98a502318f0a@hogranch.com> <c98f5172-bc5f-5987-a2c6-03766547469a@8kdata.com> <CADK3HHKyRxDKGcagk9ooqjCL=DHnieE_rp2MLTnpCpTUOn9p+A@mail.gmail.com> <9289bc74-5c08-c180-3a7a-943c79230824@8kdata.com> <41ED3F5450C90F4D8381BC4D8DF6BBDCAF6CA67F@EXCHANGESERVER.ikoffice.de> <5989a0cc-8318-28a7-9389-b284f42f671c@8kdata.com> <41ED3F5450C90F4D8381BC4D8DF6BBDCAF6CA6F3@EXCHANGESERVER.ikoffice.de> <58330587-d79c-78e0-b239-2db7c59cecef@8kdata.com> <10139f8589debc46122b31ecf3720626@edno.moe> <971a86da-3576-1a1d-e80a-40038bf9793b@8kdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox