public inbox for [email protected]  
help / color / mirror / Atom feed
From: Manni Wood <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: Nazir Bilal Yavuz <[email protected]>
Cc: KAZAR Ayoub <[email protected]>
Cc: Neil Conway <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Shinya Kato <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Date: Mon, 16 Feb 2026 23:01:21 -0600
Message-ID: <CAKWEB6p-9cwDhnN4GKOFz0Yzqb7PtTLChH-+wjd-SNhrbiJuLA@mail.gmail.com> (raw)
In-Reply-To: <aZNewLWZ4MbrrrLv@nathan>
References: <CA+K2Run1VdLnmp-5_Qv2Fax0KgT7LLJMH-uzjaaf-NZD1oU-=w@mail.gmail.com>
	<aYZdKSTw6N3khsVE@nathan>
	<CAN55FZ2DOeLjSXE2Jos99bgHG-Zeo3KjStrSgoA8Rf=2Mu+hFA@mail.gmail.com>
	<aYZvdsXPElQvwWOA@nathan>
	<CAN55FZ1=O6TjeZM2CUT7T2tu66uJT+w3G9FiRXVs+gt_ousFxQ@mail.gmail.com>
	<aY0FL4rXUl6ykn-a@nathan>
	<CAN55FZ3g6QaiC8G4GMjdJ24egvgc-HG_xpoOztxnM_wnQNn5aw@mail.gmail.com>
	<aY-vJe_ENCB-fux9@nathan>
	<CAKWEB6p-Y54yWA5kq6OXEYV=ABdHenJ559i0MshOoYkP4i=o5A@mail.gmail.com>
	<aZNOOjyeWLv9_7fr@nathan>
	<aZNewLWZ4MbrrrLv@nathan>

On Mon, Feb 16, 2026 at 12:15 PM Nathan Bossart <[email protected]>
wrote:

> On Mon, Feb 16, 2026 at 11:04:58AM -0600, Nathan Bossart wrote:
> > On Fri, Feb 13, 2026 at 09:34:13PM -0600, Manni Wood wrote:
> >> v7-0001 + v7-0002 applied to master certainly seems promising: nice to
> see
> >> speed improvements across the board on both x86 and arm!
> >
> > Thanks for testing.  Based on these results, I think we can abandon 0002,
> > at least for now.
>
> Have you tested small rows, i.e., less than 16 bytes per row?  I'm
> wondering if that regresses at all.
>
> --
> nathan
>

I ran some tests using narrow rows that look like this:

$ head t_none.txt
BB      AA
BB      AA
BB      AA

$ head t_none.csv
BB,AA
BB,AA
BB,AA

$ head t_escape.txt
B\\B    A\\A
B\\B    A\\A
B\\B    A\\A

$ head t_quote.csv
"B""B","A""A"
"B""B","A""A"
"B""B","A""A"

Here are the results on my x86 tower and my arm raspberry pi 5:

x86 NARROW master copy from
TXT :                 2477.022500 ms
CSV :                 2825.095500 ms
TXT with 1/3 escapes: 2620.575000 ms
CSV with 1/3 quotes:  3249.058750 ms

x86 NARROW v70001 copy from
TXT :                 2475.659000 ms  0.055046% improvement
CSV :                 2421.976750 ms  14.269208% improvement
TXT with 1/3 escapes: 2660.953750 ms  -1.540836% regression
CSV with 1/3 quotes:  3255.546750 ms  -0.199689% regression

x86 NARROW v70002 copy from
TXT :                 2481.372250 ms  -0.175604% regression
CSV :                 2437.541250 ms  13.718271% improvement
TXT with 1/3 escapes: 2646.300000 ms  -0.981655% regression
CSV with 1/3 quotes:  3202.014500 ms  1.447935% improvement


arm NARROW master copy from
TXT :                 2294.270500 ms
CSV :                 2085.839000 ms
TXT with 1/3 escapes: 2467.966000 ms
CSV with 1/3 quotes:  2485.533000 ms

arm NARROW v70001 copy from
TXT :                 1982.497500 ms  13.589200% improvement
CSV :                 2005.829500 ms  3.835843% improvement
TXT with 1/3 escapes: 2111.778250 ms  14.432442% improvement
CSV with 1/3 quotes:  2441.370000 ms  1.776802% improvement

arm NARROW v70002 copy from
TXT :                 1975.982250 ms  13.873179% improvement
CSV :                 2022.744000 ms  3.024922% improvement
TXT with 1/3 escapes: 2080.273000 ms  15.709009% improvement
CSV with 1/3 quotes:  2476.819000 ms  0.350589% improvement

Hope this helps!
-- 
-- Manni Wood EDB: https://www.enterprisedb.com


view thread (21+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
  In-Reply-To: <CAKWEB6p-9cwDhnN4GKOFz0Yzqb7PtTLChH-+wjd-SNhrbiJuLA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox