Re: Speed up COPY FROM text/CSV parsing using SIMD

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Manni Wood <manni(dot)wood(at)enterprisedb(dot)com>, KAZAR Ayoub <ma_kazar(at)esi(dot)dz>, Neil Conway <neil(dot)conway(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Date: 2026-02-26 12:19:32
Message-ID: CAN55FZ1inW-w-oqDwU32bLpC05XWQMY=SEMOtim74BNRekSjHQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, 25 Feb 2026 at 17:24, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> wrote:
>
> I agree with you. However, unfortunately, I see regression on master +
> v10 compared to REL_18_3 (62d6c7d3df6).
>
> Thank you Kazar and Manni for benchmarks in [1] and [2]!

Kazar and Manni, if possible could you please share the build commands
you use? I see regressions for an inlining patch (dc592a4155) too when
I build postgres with -O2.

My build commands are:

-O2: meson setup buildtype=debugoptimized ...

-O3: meson setup buildtype=release ...

This is a wide benchmark only, old master means b2ff2a0b529 without
0001 inlining patch (dc592a4155):

+--------------------------+---------------+---------------+
| | Text | CSV |
+--------------------------+-------+-------+-------+-------+
| -O2 | None | 1/3 | None | 1/3 |
+--------------------------+-------+-------+-------+-------+
| Old Master | 10440 | 11000 | 11940 | 13600 |
+--------------------------+-------+-------+-------+-------+
| Old Master + 0001 | 10140 | 10800 | 11600 | 14300 |
+--------------------------+-------+-------+-------+-------+
| Old Master + 0001 + 0002 | 9000 | 11000 | 8850 | 15300 |
+--------------------------+-------+-------+-------+-------+
| | | | | |
+--------------------------+-------+-------+-------+-------+
| | Text | | CSV |
+--------------------------+-------+-------+-------+-------+
| -O3 | None | 1/3 | None | 1/3 |
+--------------------------+-------+-------+-------+-------+
| Old Master | 10440 | 11200 | 12200 | 14390 |
+--------------------------+-------+-------+-------+-------+
| Old Master + 0001 | 10000 | 10700 | 11540 | 13960 |
+--------------------------+-------+-------+-------+-------+
| Old Master + 0001 + 0002 | 8880 | 10900 | 8900 | 15100 |
+--------------------------+-------+-------+-------+-------+

This result shows that when we compare v18 and v18 + SIMD (0001 +
0002), there is only regression for the CSV 1/3 case. The regression
is %12.5 for the -O2 and %5 for the -O3.

--
Regards,
Nazir Bilal Yavuz
Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-26 12:23:49 Re: persevere NO INHERIT when Dump not-null constraints on inherited columns
Previous Message Álvaro Herrera 2026-02-26 12:19:25 Re: Adding REPACK [concurrently]