Script which shows performance of ByteA: ascii vs binary

From: Thomas Güttler <guettliml(at)thomas-guettler(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org, adrian(dot)klaver(at)aklaver(dot)com, hjp-pgsql(at)hjp(dot)at, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Script which shows performance of ByteA: ascii vs binary
Date: 2019-03-22 10:23:54
Message-ID: d6a0a060-f61c-7f5d-b109-dfa94eb378b2@thomas-guettler.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for asking several times for a benchmark.

I wrote it now and it is visible: inserting random bytes into bytea is much slower,
if you use the psycopg2 defaults.

Here is the chart:
https://github.com/guettli/misc/blob/master/bench-bytea-inserts-postrgres.png

And here is the script which creates the chart:
https://github.com/guettli/misc/blob/master/bench-bytea-inserts-postrgres.py

Please let me know if there is something wrong or could get improved.

Regards,
Thomas Güttler

Am 18.03.19 um 15:33 schrieb Thomas Güttler:
> I did some benchmarking and in my setup there was major
> performance difference.
>
> I tested a ByteA column.
>
> If I used ascii data the tests took 52 seconds.
> If I used random binary data the test took 250 seconds.
>
> binary data is (roughly) five times slower than ascii data?
>
> Is this a know fact, or is there something wrong with my benchmark?
>
> I used Python and psycopg2.
>
> Regards,
>   Thomas Güttler
>
>

--
Thomas Guettler http://www.thomas-guettler.de/
I am looking for feedback: https://github.com/guettli/programming-guidelines

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2019-03-22 10:43:54 Re: Logical replication - DDL sub transactions for script executed in single transaction?
Previous Message David Rowley 2019-03-22 10:15:30 Re: Column lookup in a row performance