Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vtE5b-00AcE3-1w for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 00:09:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vtE5a-0068KH-0q for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 00:09:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vtE5Z-0068K8-2o for pgsql-hackers@lists.postgresql.org; Fri, 20 Feb 2026 00:09:45 +0000 Received: from mail-dy1-x1333.google.com ([2607:f8b0:4864:20::1333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vtE5V-00000000IIr-290n for pgsql-hackers@postgresql.org; Fri, 20 Feb 2026 00:09:44 +0000 Received: by mail-dy1-x1333.google.com with SMTP id 5a478bee46e88-2baab3137bcso1387969eec.0 for ; Thu, 19 Feb 2026 16:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771546179; cv=none; d=google.com; s=arc-20240605; b=capNWdMo7RLQNlJSgZcJf9yCoznF/wv4Uev4Uk5YCoAAdt8PNjuLt/ShGjT73x+PUL vwHcx7aOH3U5XtmKhA9xA4LckSPDpuZOxwfQjgUoJK+UhzwVreA0waK0gLJ1PeYo9v9i Mo992O1KILyg5o5lzPr92hF6L6krQghE0mDkqFt34jukA69SBh7MCvrxMKvTIuT8QA+8 vSTx9Wa1dC2VV/u5nKLM9/wGks+5bmE/AKxrQmBvBPnvpuhdP0Xih5P3CjN52FqVsfQZ 29YGn0dAh0wi8TnFoDqP2d5Lz+4rLAYRLyp5iXqa3VkbbljJ8r4ykXBwrv2USka3xI7c c+ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=LaY213ijPWFMudGnwpvYEbxx+Tvrq1ne0/K9xeXEYYk=; fh=gv0bW30ys1U3lHWF9T3OC9rQAzuPLoNGUfN5ztnmGl4=; b=e2ZTgUv7R7T7bnIA09o0HVrpQVgSEKa1DT4Be4gngPi5iwQKYo+iDuikH63O/GP2Fd KG6vaD7zeYeoIbXAr6BfeQzDNfb0JMN+IDJCRr0kCQGd9kxxk+ybsBAScta0CFg40aDn AXsBXqqf6p0IOF7SMmMqIMjCq84NZGtPDpWUSpWALgMTXrp6jB6pu+hTsuUmcFxqukfH Ira8v5OAwVsxtHL4X4WkkPfYFKzjqJZbCdN+p2BGDFIHnJdisqhBlji4jHNKNfWEYDxh 3c9UyyUd1ukpbzevTkinJvdlgcB28p+Dfi/v4amE5uoK7gm/S8HKj00XUBj4CsHBQppi QO7g==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1771546179; x=1772150979; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LaY213ijPWFMudGnwpvYEbxx+Tvrq1ne0/K9xeXEYYk=; b=dtIdkt/dSUbZ+KS56/h5AWpd76I8CfCI0cKkMuX2pNeHFnjfSEETZR8YQW6Xb/4Z/6 cK0MeLzKbth6duRCoUnpWZf0A9/HxqJ2lpP/9RQkA0u1mmXfedeYNNsm2El1XaVlFSso X3gnUq+Y27xU4cb2fyf6VJLTtOvNauFAswl6vHkQn84G6W2tQr3cQgZEHOp31MOUiwN6 d+GpKQr6SGS+dfkimnL9pV5VqG4xYMJibvCQlZOlee4n62zRd62tRiqt0h8Qam59bRxc 0CIYQqzI9AT+mUmV5XGNmfGA7fGT7I7+J6DYXkAp6MVIEPx1d2NqD/CdaW/dMKzSICcd 5k5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771546179; x=1772150979; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LaY213ijPWFMudGnwpvYEbxx+Tvrq1ne0/K9xeXEYYk=; b=CtaadNDWQ1TECAs3c83j2HBosVQlpROjO/gttF1ZpkluP1+MDUCJEAD9KyQ9zOI0E9 GFD5/x+ajYtNstrXzhaVi8TVDMt0Tz3Ib/+o9GWt2FEi10jv4xWRsQRiRZvPSZkEuIRb IQ9ewYP0msgzX9ri4Qt6+poLeTkpQFN/ztke9uHVLdN5LoDDR2atl118srv1j3uq18BE ajizXqcCZQyho0EcAntdqhpMt8A+hF4Ih0kV5GCGeQmPF4sQbKLamldjE/mZnwFWPcBt EHX1v2kVoA9XfjBxJd17YPuXxZf+ZlaR/QQ40v/ODvRQQ8TCU9ixfqBD+IGBd4GhRTjC wdiA== X-Forwarded-Encrypted: i=1; AJvYcCV/JVQ8x0lM7mQo/hAlvJfesPjOF+jde+plYjXqMhHkIVxt0fmwfvZ3LCw/NfQqszGJmyYxgPaVtpP7dTTq@postgresql.org X-Gm-Message-State: AOJu0YyHCSqp7V3AlOSvHzSvIcDVpO1bEtgVlV4EbSo260AwjjQOjA0e wO+7Cjc5zSRLDDfts7tNf8YkdGtbvx8RBgOZZY/kMtEa55szFVu3/trMcab/yzMcaAJx5AgNdK3 I29HkZ5JS+FV+RLCY6ehdaHAJpRmnaoTGRoLpLIkl X-Gm-Gg: AZuq6aLfAMN734hB5WE5D/00x1tmqO352RBQEfLsWsqwaYnXMeyxqNMhNXrv3++PJqe IOHicRjMW/OzreVj0QH9JjlnK7k97/b6qWc0rcPvyYbOqHKM9C7BYUkkUjJgsqpE14WcVXdmB3M lKuFxzHd9XjWZm4UNfAmZF1vJfvZMcUOdctHvFh1Ht9c3/7A2W89u/w9glgbO//Q5EdIOi+H1qN QQzTgrRMwYHdS/gw5LtQu/I5R3jAam2VIqNch1XMcpczWaHHWGYDGqJ2bQxkyF7IpL2ZfG2JPct Bf/3DcGPG9/kXn+h/NI= X-Received: by 2002:a05:693c:2b06:b0:2ba:69d1:7622 with SMTP id 5a478bee46e88-2bac9811a66mr7921695eec.40.1771546178478; Thu, 19 Feb 2026 16:09:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Manni Wood Date: Thu, 19 Feb 2026 18:09:27 -0600 X-Gm-Features: AaiRm52lVeLAeHokoHFDBnNDxgXTQtRJ2rEi4wN44aNIX5PufRLpL5UgpFEQAiA Message-ID: Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD To: KAZAR Ayoub Cc: Nazir Bilal Yavuz , Nathan Bossart , Neil Conway , Andrew Dunstan , Shinya Kato , PostgreSQL-development Content-Type: multipart/alternative; boundary="000000000000abf7cb064b363c73" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000abf7cb064b363c73 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 19, 2026 at 4:37=E2=80=AFPM KAZAR Ayoub wrote= : > Hello, > > I ran some long benchmarks on this, and I got stable results across > multiple runs (few milliseconds difference) > > This is on an Intel I7-1255U CPU with: > sudo cpupower frequency-set --governor=3Dperformance > sudo cpupower idle-set -D 0 > echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo > > WIDE (500k rows) > > TXT | none > Master avg: 22,183 ms > New avg: 20,435 ms > Improvement: -7.88% > > CSV | none > Master avg: 26,737 ms > New avg: 24,625 ms > Improvement: -7.90% > > TXT | escape > Master avg: 26,720 ms > New avg: 23,658 ms > Improvement: -11.46% > > CSV | quote > Master avg: 35,961 ms > New avg: 33,317 ms > Improvement: -7.35% > > -------------------------------------- > > NARROW (1.5M rows) > > TXT | none > Master avg: 2,220 ms > New avg: 2,125 ms > Improvement: -4.28% > > CSV | none > Master avg: 2,330 ms > New avg: 2,145 ms > Improvement: -7.92% > > TXT | escape > Master avg: 2,425 ms > New avg: 2,187 ms > Improvement: -9.79% > > CSV | quote > Master avg: 2,272 ms > New avg: 2,253 ms > Improvement: -0.85% > > No regressions as expected, overall this looks good. > > Regards, > > Ayoub > > On Thu, Feb 19, 2026 at 10:01=E2=80=AFAM Nazir Bilal Yavuz > wrote: > >> Hi, >> >> On Thu, 19 Feb 2026 at 07:02, Manni Wood >> wrote: >> > >> > I took some time tonight to apply v8 to the latest master (759b03b2) o= n >> my x86 tower and arm raspberry pi 5. >> > >> > Here are the results, using both narrow columns and the wider columns >> we've been using througout: >> > >> > x86 master NARROW >> > TXT : 2587.642000 ms >> > CSV : 2621.759000 ms >> > TXT with 1/3 escapes: 2707.933500 ms >> > CSV with 1/3 quotes: 3254.896500 ms >> > >> > x86 v8 NARROW >> > TXT : 2488.655250 ms 3.825365% improvement >> > CSV : 2628.818000 ms -0.269247% regression >> > TXT with 1/3 escapes: 2615.522000 ms 3.412621% improvement >> > CSV with 1/3 quotes: 3446.368000 ms -5.882568% regression >> > >> > x86 master WIDE >> > TXT : 30583.229500 ms >> > CSV : 35054.533500 ms >> > TXT with 1/3 escapes: 32767.421500 ms >> > CSV with 1/3 quotes: 44214.163500 ms >> > >> > x86 v8 WIDE >> > TXT : 26527.494250 ms 13.261305% improvement >> > CSV : 33364.443750 ms 4.821316% improvement >> > TXT with 1/3 escapes: 29320.648000 ms 10.518904% improvement >> > CSV with 1/3 quotes: 42334.074750 ms 4.252232% improvement >> > >> > >> > >> > arm master NARROW >> > TXT : 1999.401000 ms >> > CSV : 2081.610750 ms >> > TXT with 1/3 escapes: 2053.230250 ms >> > CSV with 1/3 quotes: 2431.608750 ms >> > >> > arm v8 NARROW >> > TXT : 1981.663750 ms 0.887128% improvement >> > CSV : 2023.892500 ms 2.772769% improvement >> > TXT with 1/3 escapes: 2004.215250 ms 2.387214% improvement >> > CSV with 1/3 quotes: 2616.872750 ms -7.618989% regression >> > >> > arm master WIDE >> > TXT : 9120.731750 ms >> > CSV : 11114.478250 ms >> > TXT with 1/3 escapes: 10338.124500 ms >> > CSV with 1/3 quotes: 13404.430250 ms >> > >> > arm v8 WIDE >> > TXT : 8430.090750 ms 7.572210% improvement >> > CSV : 10115.135500 ms 8.991360% improvement >> > TXT with 1/3 escapes: 9624.383500 ms 6.903970% improvement >> > CSV with 1/3 quotes: 12331.714000 ms 8.002699% improvement >> >> Thank you for the results, they are interesting. I didn't expect to >> see any regression for this benchmark. Also, I would expect the >> non-special character cases and the 1/3 special character cases to >> perform similarly, since we are not using SIMD for this benchmark. >> >> I noticed that the timings in your narrow benchmark (both x86 and ARM) >> are quite short. Would it be possible to extend the test so that the >> total runtime is closer to ~10,000 ms? That might give us more stable >> results. >> >> Here is my benchmark with using your script: >> >> WIDE: Total 500000 lines and each line is 4096 bytes. >> NARROW: Total 1500000 lines and each line is 2-4 bytes (`"A""A"` and >> `A\\A`). >> >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | WIDE | TXT None | TXT 1/3 | CSV None | CSV 1/3 >> | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | master | 10512 | 11133 | 12241 | 14321 >> | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | patched | 10000 (-%4.8) | 10804 (-%2.9) | 11571 (-%5.4) | 14008 >> (-%2.18) | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | | | | | >> | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | NARROW | | | | >> | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | master | 9702 | 9745 | 9784 | 10149 >> | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> | patched | 9344 (-%3.6) | 9477 (-%2.7) | 9439 (-%3.5) | 9751 (-%3.9) >> | >> >> +---------+---------------+---------------+---------------+-------------= ---+ >> >> The results look promising to me. >> >> -- >> Regards, >> Nazir Bilal Yavuz >> Microsoft >> > Hello! Thanks for running benchmarks, Ayoub. Nazir, I ran my benchmarks with more rows this time --- as many rows as would fit on my test computers without exhausting their RAM disks. That seems to have brought things more into line with what Ayoub saw. I did get some small regressions, but I suspect those are not a big deal. (For instance, on both machines I also noticed the occasional "truncate table" would take longer than the others, despite my scripts' best efforts to steady a CPU core and pin postmaster and children to that core.) x86 WIDE master 500,000 rows TXT : 30602.244000 ms CSV : 35062.451250 ms TXT with 1/3 escapes: 32704.250250 ms CSV with 1/3 quotes: 44128.072500 ms x86 WIDE v8 500,000 rows TXT : 26611.953250 ms 13.039210% improvement CSV : 33366.184000 ms 4.837846% improvement TXT with 1/3 escapes: 29251.310000 ms 10.558078% improvement CSV with 1/3 quotes: 42368.421000 ms 3.987601% improvement x86 NARROW master 50mil rows TXT : 25898.004000 ms CSV : 27212.684500 ms TXT with 1/3 escapes: 29189.518250 ms CSV with 1/3 quotes: 33222.510250 ms x86 NARROW v8 50mil rows TXT : 26368.765000 ms -1.817750% regression CSV : 26711.122250 ms 1.843119% improvement TXT with 1/3 escapes: 28081.150750 ms 3.797142% improvement CSV with 1/3 quotes: 32851.963500 ms 1.115348% improvement arm WIDE master 250,000 rows TXT : 11392.462750 ms CSV : 13887.576500 ms TXT with 1/3 escapes: 12908.560750 ms CSV with 1/3 quotes: 16699.337000 ms arm WIDE v8 250,000 rows TXT : 10524.567750 ms 7.618151% improvement CSV : 12621.211250 ms 9.118691% improvement TXT with 1/3 escapes: 12017.030250 ms 6.906506% improvement CSV with 1/3 quotes: 15428.020500 ms 7.612976% improvement arm NARROW master 25mil rows TXT : 10030.274000 ms CSV : 10245.238750 ms TXT with 1/3 escapes: 10345.224500 ms CSV with 1/3 quotes: 12186.313250 ms arm NARROW v8 25mil rows TXT : 10197.386500 ms -1.666081% regression CSV : 10257.918750 ms -0.123765% regression TXT with 1/3 escapes: 10084.978500 ms 2.515615% improvement CSV with 1/3 quotes: 12064.215000 ms 1.001929% improvement --=20 -- Manni Wood EDB: https://www.enterprisedb.com --000000000000abf7cb064b363c73 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On T= hu, Feb 19, 2026 at 4:37=E2=80=AFPM KAZAR Ayoub <ma_kazar@esi.dz> wrote:
Hello,

I ran some long benchmarks on this, and I got stable results across mul= tiple runs (few milliseconds difference)

This is on an Intel I= 7-1255U CPU with:
sudo cpupower frequency-set <= /span>--governor=3Dperformance
sudo
cpupower idle-set -D 0
echo "1" | sudo tee /sys= /devices/system/cpu/intel_pstate/no_turbo

WIDE (500= k rows)

TXT | none
Master avg: 22,183 ms=
New avg: 20,435 ms
Improvement: -7.88%

CSV | none
Master avg: 26,737 ms
= New avg: 24,625 ms
Improvement: -7.90%

<= span>TXT | escape
Master avg: 26,720 ms
New= avg: 23,658 ms
Improvement: -11.46%

CSV= | quote
Master avg: 35,961 ms
New avg: 33,= 317 ms
Improvement: -7.35%

-------------------= -------------------

NARROW (1.5M rows)

TXT = | none
Master avg: 2,220 ms
New avg: 2,125 = ms
Improvement: -4.28%

CSV | none=
Master avg: 2,330 ms
New avg: 2,145 ms
= Improvement: -7.92%

TXT | escape
M= aster avg: 2,425 ms
New avg: 2,187 ms
Impro= vement: -9.79%

CSV | quote
Master avg: 2= ,272 ms
New avg: 2,253 ms
Improvement: -0.8= 5%

No regressions as expected, overall this looks good= .

Regards,

Ayoub


On Thu, Feb 19, 2026 at 10:01= =E2=80=AFAM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
Hi,

On Thu, 19 Feb 2026 at 07:02, Manni Wood <manni.wood@enterprisedb.com> wrot= e:
>
> I took some time tonight to apply v8 to the latest master (759b03b2) o= n my x86 tower and arm raspberry pi 5.
>
> Here are the results, using both narrow columns and the wider columns = we've been using througout:
>
> x86 master NARROW
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0258= 7.642000 ms
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0262= 1.759000 ms
> TXT with 1/3 escapes: 2707.933500 ms
> CSV with 1/3 quotes:=C2=A0 3254.896500 ms
>
> x86 v8 NARROW
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0248= 8.655250 ms=C2=A0 3.825365% improvement
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0262= 8.818000 ms=C2=A0 -0.269247% regression
> TXT with 1/3 escapes: 2615.522000 ms=C2=A0 3.412621% improvement
> CSV with 1/3 quotes:=C2=A0 3446.368000 ms=C2=A0 -5.882568% regression<= br> >
> x86 master WIDE
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0305= 83.229500 ms
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0350= 54.533500 ms
> TXT with 1/3 escapes: 32767.421500 ms
> CSV with 1/3 quotes:=C2=A0 44214.163500 ms
>
> x86 v8 WIDE
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0265= 27.494250 ms=C2=A0 13.261305% improvement
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0333= 64.443750 ms=C2=A0 4.821316% improvement
> TXT with 1/3 escapes: 29320.648000 ms=C2=A0 10.518904% improvement
> CSV with 1/3 quotes:=C2=A0 42334.074750 ms=C2=A0 4.252232% improvement=
>
>
>
> arm master NARROW
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0199= 9.401000 ms
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0208= 1.610750 ms
> TXT with 1/3 escapes: 2053.230250 ms
> CSV with 1/3 quotes:=C2=A0 2431.608750 ms
>
> arm v8 NARROW
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0198= 1.663750 ms=C2=A0 0.887128% improvement
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0202= 3.892500 ms=C2=A0 2.772769% improvement
> TXT with 1/3 escapes: 2004.215250 ms=C2=A0 2.387214% improvement
> CSV with 1/3 quotes:=C2=A0 2616.872750 ms=C2=A0 -7.618989% regression<= br> >
> arm master WIDE
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0912= 0.731750 ms
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0111= 14.478250 ms
> TXT with 1/3 escapes: 10338.124500 ms
> CSV with 1/3 quotes:=C2=A0 13404.430250 ms
>
> arm v8 WIDE
> TXT :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0843= 0.090750 ms=C2=A0 7.572210% improvement
> CSV :=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0101= 15.135500 ms=C2=A0 8.991360% improvement
> TXT with 1/3 escapes: 9624.383500 ms=C2=A0 6.903970% improvement
> CSV with 1/3 quotes:=C2=A0 12331.714000 ms=C2=A0 8.002699% improvement=

Thank you for the results, they are interesting. I didn't expect to
see any regression for this benchmark. Also, I would expect the
non-special character cases and the 1/3 special character cases to
perform similarly, since we are not using SIMD for this benchmark.

I noticed that the timings in your narrow benchmark (both x86 and ARM)
are quite short. Would it be possible to extend the test so that the
total runtime is closer to ~10,000 ms? That might give us more stable
results.

Here is my benchmark with using your script:

WIDE: Total 500000 lines and each line is 4096 bytes.
NARROW: Total 1500000 lines and each line is 2-4 bytes (`"A""= ;A"` and `A\\A`).

+---------+---------------+---------------+---------------+----------------= +
| WIDE=C2=A0 =C2=A0 | TXT None=C2=A0 =C2=A0 =C2=A0 | TXT 1/3=C2=A0 =C2=A0 = =C2=A0 =C2=A0| CSV None=C2=A0 =C2=A0 =C2=A0 | CSV 1/3=C2=A0 =C2=A0 =C2=A0 = =C2=A0 |
+---------+---------------+---------------+---------------+----------------= +
| master=C2=A0 | 10512=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 11133=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0| 12241=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 14321=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
+---------+---------------+---------------+---------------+----------------= +
| patched | 10000 (-%4.8) | 10804 (-%2.9) | 11571 (-%5.4) | 14008 (-%2.18) = |
+---------+---------------+---------------+---------------+----------------= +
|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
+---------+---------------+---------------+---------------+----------------= +
| NARROW=C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 |
+---------+---------------+---------------+---------------+----------------= +
| master=C2=A0 | 9702=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 9745=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 | 9784=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 10149=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
+---------+---------------+---------------+---------------+----------------= +
| patched | 9344 (-%3.6)=C2=A0 | 9477 (-%2.7)=C2=A0 | 9439 (-%3.5)=C2=A0 | = 9751 (-%3.9)=C2=A0 =C2=A0|
+---------+---------------+---------------+---------------+----------------= +

The results look promising to me.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Hello!

<= div>Thanks for running benchmarks, Ayoub.

Nazir, I= ran my benchmarks with more rows this time --- as many rows as would fit o= n=C2=A0 my test computers without exhausting their RAM disks. That seems to= have brought things more into line with what Ayoub saw. I did get some sma= ll regressions, but I suspect those are not a big deal. (For instance, on b= oth machines I also noticed the occasional "truncate table" would= take longer than the others, despite my scripts' best efforts to stead= y a CPU core and pin postmaster and children to that core.)

<= /div>
x86 WIDE master 500,000 rows
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 30602.244000 ms
CSV : =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 35062.451250 ms
TXT with 1/3 escapes:= 32704.250250 ms
CSV with 1/3 quotes: =C2=A044128.072500 ms

x86 W= IDE v8 500,000 rows
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 26611.953250 ms =C2=A013.039210% improvement
CSV : =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 33366.184000 ms =C2=A04.83784= 6% improvement
TXT with 1/3 escapes: 29251.310000 ms =C2=A010.558078% im= provement
CSV with 1/3 quotes: =C2=A042368.421000 ms =C2=A03.987601% imp= rovement

x86 NARROW master 50mil rows
TXT : =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 25898.004000 ms
CSV : =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 27212.684500 ms
TXT with 1/3 e= scapes: 29189.518250 ms
CSV with 1/3 quotes: =C2=A033222.510250 ms
x86 NARROW v8 50mil rows
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 26368.765000 ms =C2=A0-1.817750% regression
CSV : =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 26711.122250 ms =C2=A0= 1.843119% improvement
TXT with 1/3 escapes: 28081.150750 ms =C2=A03.7971= 42% improvement
CSV with 1/3 quotes: =C2=A032851.963500 ms =C2=A01.11534= 8% improvement


arm WIDE master 250,000 rows
TXT : =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 11392.462750 ms
CSV : =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 13887.576500 ms
TXT= with 1/3 escapes: 12908.560750 ms
CSV with 1/3 quotes: =C2=A016699.3370= 00 ms

arm WIDE v8 250,000 rows
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 10524.567750 ms =C2=A07.618151% improvement
= CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 12621.211250 = ms =C2=A09.118691% improvement
TXT with 1/3 escapes: 12017.030250 ms =C2= =A06.906506% improvement
CSV with 1/3 quotes: =C2=A015428.020500 ms =C2= =A07.612976% improvement

arm NARROW master 25mil rows
TXT : =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10030.274000 ms
CSV= : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10245.238750 ms<= br>TXT with 1/3 escapes: 10345.224500 ms
CSV with 1/3 quotes: =C2=A01218= 6.313250 ms

arm NARROW v8 25mil rows
TXT : =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10197.386500 ms =C2=A0-1.666081% regress= ion
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10257.= 918750 ms =C2=A0-0.123765% regression
TXT with 1/3 escapes: 10084.978500= ms =C2=A02.515615% improvement
CSV with 1/3 quotes: =C2=A012064.215000 = ms =C2=A01.001929% improvement

--
-- Manni Wood EDB: https://www.enterprisedb.com
--000000000000abf7cb064b363c73--