pg.ddx.io pgsql-hackers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Andreas Karlsson <andreas@proxel.se>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: libpq compression
Date: Wed, 13 Feb 2019 18:03:04 +0300
Message-ID: <8da581ac-62a5-a64a-7dc4-f09ce936612a@postgrespro.ru> (raw)
In-Reply-To: <CA+q6zcU4FCCt_V=v3yJXmr-xh-i_EgCVVg5W+ys9oHNmZSr2aw@mail.gmail.com>
References: <aad16e41-b3f9-e89d-fa57-fb4c694bec25@postgrespro.ru>
<20190208071431.skfmpbeclrkpzuac@alap3.anarazel.de>
<8d210267-a2fa-662f-b167-0e5991d45dd7@proxel.se>
<eb3e3b41-24d1-8898-f71d-2975477b6a83@2ndquadrant.com>
<436d1e08-dd9c-d36a-1c0d-517a70a83cd4@proxel.se>
<92435f1b-77aa-4386-4cf1-788b3c3d4365@postgrespro.ru>
<CA+q6zcUPrssNaRS+FyoBsD-F2stK1Roa-4sAhFOfAjOWLziM4g@mail.gmail.com>
<dcc86dc6-5401-f2cc-9b3b-b5bcca2d7a45@postgrespro.ru>
<CA+q6zcW-EdonARyWjEJ9FhikOAn3i-uFAjv2mMM1zwO824XqOg@mail.gmail.com>
<CA+q6zcU4FCCt_V=v3yJXmr-xh-i_EgCVVg5W+ys9oHNmZSr2aw@mail.gmail.com>
On 13.02.2019 17:54, Dmitry Dolgov wrote:
>> On Wed, Feb 13, 2019 at 3:52 PM Dmitry Dolgov <9erthalion6@gmail.com> wrote:
>>
>>> On Wed, Feb 13, 2019 at 3:46 PM Konstantin Knizhnik
>>> <k.knizhnik@postgrespro.ru> wrote:
>>>
>>> Moreover, please notice that your implementation is still passing functions
>>> tx/rx functions to stream constructor and so zpq_read is still able to read
>>> data itself. So I do not understand which problem you have solved by
>>> replacing zpq_read with pair of zpq_read_drain+zpq_read.
>> Nope, I've removed the call of these functions from zlib_read/write, just
>> forgot to remove the initialization part.
> Oh, I see the source of confusion. Due to lack of time I've implemented my
> changes only for zlib part, sorry that I didn't mention that before.
And I have looked at zstd part;)
Ok, but still I think that it is better to pass tx/rx function to stream.
There are two important advantages:
1. It eliminates code duplication.
2. It allows to use (in future) this streaming compression not only for
libpq for for other streaming data.
And I do not see any disadvantages.
Concerning "layering violation" may be it is better to introduce some
other functions something like inflate_read, deflate_write and call them
instead of *secure_read.
But from my point of view it will not improve readability and modularity
of code.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
view thread (289+ messages) latest in thread
Message-ID: <8da581ac-62a5-a64a-7dc4-f09ce936612a@postgrespro.ru> Permalink: ../8da581ac-62a5-a64a-7dc4-f09ce936612a@postgrespro.ru/ Also on: postgresql.org/message-id/8da581ac-62a5-a64a-7dc4-f09ce936612a@postgrespro.ru ·
reply
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 using the --to and --cc options: reply via email To: pgsql-hackers@postgresql.org Cc: k.knizhnik@postgrespro.ru, 9erthalion6@gmail.com, andreas@proxel.se, peter.eisentraut@2ndquadrant.com, andres@anarazel.de Subject: Re: libpq compression In-Reply-To: <8da581ac-62a5-a64a-7dc4-f09ce936612a@postgrespro.ru> * 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