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 1vv6AS-003Gp0-16 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 04:06:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vv6AQ-004U1x-1B for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Feb 2026 04:06:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vv6AP-004U1o-2u for pgsql-hackers@lists.postgresql.org; Wed, 25 Feb 2026 04:06:30 +0000 Received: from mail-dy1-x132d.google.com ([2607:f8b0:4864:20::132d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vv6AL-000000013nU-2IIA for pgsql-hackers@postgresql.org; Wed, 25 Feb 2026 04:06:27 +0000 Received: by mail-dy1-x132d.google.com with SMTP id 5a478bee46e88-2b6b0500e06so8051741eec.1 for ; Tue, 24 Feb 2026 20:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771992385; cv=none; d=google.com; s=arc-20240605; b=KuwtTn/gAN3NJLXIT36da36gnqBSX6TdejX27nWWki8fL9lib9XYChRMQWjYARGzsp xYv3PR6OMIDM88/Ci9VyCVYsohcy3A1tdmcz0rY0fCwGx65KIresCPDJchKpwLeVha0l E8KWzvMzbsLHOdxxz7fN8OGXUpM9Svw5mNWqnxkJBL8im8rfKUrUr9FobUAi8Cj+j2Wz +tWVhSZ/QJ5jUuvNGHdJWdJZBlvE+K2RahPIUhOLeBcWv/AEnGshdreI9XVMJFdKTCp1 T0tXVfRI8nM3mBsKiFsc51WRXzhZQtVpBPWj94kfT797fyhbJHK9QF9rfdfbORDgrXof F8Jw== 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=bgVpc8AwJlFDAhX/VfM+9GOmgKWf4rSnzQxO2fDz7pE=; fh=oxkFQHcwTl+xl1lAOiNwrPXVDrkpQm8AEFyu/7ZfYGk=; b=jaKqXv0vNSdp/osPzVK/8r5Ge1FPaidmTtv/Fr2J+/f6uGCa8wB6I0skLceOnjVIqM JcS7TBA05kJCmJsjFCV9ladgEJRwzm4wNKlz2FH8O1yCaVZmEVqYLIGdm6BHUReZbT/i tQ61zRObXcTmqlMFBPxVMSEKpd0XMqM0g2SJOGiJZvKnye3J8ZYTx12i1eewFmW0YX57 aXhUwQR3HFLIjwjoMjDWkOJ5YKs1Vd7PrOgp/79fy7d2VHOj+rTJ+9SAEhEFFrVCFDVi YmLamYhkw7fe/2y56bjdg0czongqOMdVsbWSRZlWgFB6jgdnsSP1n9CSjvac8Kg5HnjQ 7SvQ==; 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=1771992385; x=1772597185; 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=bgVpc8AwJlFDAhX/VfM+9GOmgKWf4rSnzQxO2fDz7pE=; b=HQZq+8NwrfJjUql1CKS07VRteQ3Qq0SbW9uMxQ7zYWDNVLZ6WN2EsNfQZ2nQjiLra+ B+5VrUO3em0QfWPi9Z3F2aFy3RWsb+L8ziXQB6Mfe1mGW1NzSHBHcLY9YscrZAU3uVN+ IH+wkaKoO0yVNBGUs6yfkyaHnOatbHDa8yHqs/Vw84oSvP6Z7jX/Eap5HfTtCI62Td88 sISEgm6AMBOexz8TZ7CACzxnIcNYZovndvaOBaSPhA70o83Vjkd0S9G21N33kuiqpg4/ ri6zLBtpvjUqic+p+1R8LcF2u73txFUzH4JRYBz6rqPF4kPwGndMc/lKj4SotXegyCXm YFwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771992385; x=1772597185; 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=bgVpc8AwJlFDAhX/VfM+9GOmgKWf4rSnzQxO2fDz7pE=; b=D52Zw68ijSJlHCU/PQDeyPOnUOeiPz7pbqyeMCO+rkMLEPV4qGjEgkB+dkTGkcIQOJ ctAhpF7dMzfYZTbChG6l5dp43DLpwCWpIReQnwQMRK8ZebrYClo8pwNdVkTNYWqMC4i1 ccoTe8NVTl0qKKtdxdHNAeM1TjoJJfZPxoi+Nv0AZV4FGwYOstTdsoiNvNEYq7SBSb+b ZsYCZ491TTFOAhK/o1bvmTHGBXVPvLfvQJ2yZoAptnpc0M3F5l803uOVEnhsuVCzPIXt 0MPQiVsf5jsxUedd/lL3noX1aAnt60XpE2OCPQloK5P3MPVsbYzE2Q3oTpihxhAzeeFf 7WFQ== X-Forwarded-Encrypted: i=1; AJvYcCXghRSKDwv3UsT3jswJrBbjlGwwHdVjkKW3k9hsE30w2BHMg1LHeDbs3ENzmU/PQMQeQRPl/TGKCYTbNiU0@postgresql.org X-Gm-Message-State: AOJu0YxjYBw6fZeJeZiERNn2BvZTbLajIOBPyGQfRuuQMv6X29y/Nh3Q FUVTWeYJOZ5/k2uZJhzIthEld4GcRcEMIthFF9lBta7UwhwhOvhZ9ucNVIP7qAzKqMfenaENChj +Y6g0TNxwWL0kv7bvd/fq4E/515/N7a84uEOUMuUd X-Gm-Gg: ATEYQzyjXLRFl2vr/8lOAh1BfsNPHPZGXEXM4Zp6+WVFsVr1vQcmbt64h9l6DmXU3kk vilrj7R2kdxNxRhQEGGj6pmrrA9iC1fJYlnA09zKlz2uxHvl946smgB2QP/5RLKfeM4eYTve2l4 bh0fF0KEL+AOKtdBNuF4R+TaV3yG3IhJL7SRLvwsHpWKdl5yYzO8FgNJYLxuxg7vJIc4u8gKaI5 CvX08TS9Fz7aU1JRfiWVq3F/ZO7vEbNEcfJlalW/5setyJNmo1tJFciHwYG7ZNJydRFSGVtl/JU GLDesRUg X-Received: by 2002:a05:7300:ed0f:b0:2ba:7783:d1d4 with SMTP id 5a478bee46e88-2bd7bae9cc4mr6438464eec.8.1771992385173; Tue, 24 Feb 2026 20:06:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Manni Wood Date: Tue, 24 Feb 2026 22:06:13 -0600 X-Gm-Features: AaiRm52fSPobjNX29zLN3fSeCvK49ZyzO9ovoIr7DseTFiNF4mNbmz87oY2dCNM Message-ID: Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD To: Nathan Bossart Cc: Nazir Bilal Yavuz , KAZAR Ayoub , Neil Conway , Andrew Dunstan , Shinya Kato , PostgreSQL-development Content-Type: multipart/alternative; boundary="000000000000a9ccbb064b9e20e7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a9ccbb064b9e20e7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 24, 2026 at 11:48=E2=80=AFAM Nathan Bossart wrote: > On Tue, Feb 24, 2026 at 04:57:21PM +0300, Nazir Bilal Yavuz wrote: > > I will investigate this. However, please note that the current master > > includes the inlining commit (dc592a4155), which makes the COPY FROM > > faster. In my case, > > > > 1: current master without dc592a4155: 14400ms > > 2: current master: 13960ms (%3 improvement against #1) > > 3: current master + SIMD: 15123ms (%5 regression against #1 and %8 > > regression against #2) > > > > Is it possible for you to do a similar test? I mean dropping > > dc592a4155 from the current master and re-running the benchmark, that > > would be helpful. > > IMHO as long as the difference from v18 looks reasonable, commit-by-commi= t > regressions and improvements that even out in the end are okay. That's > perhaps a bit of mental gymnastics (e.g., what if we had committed the > inlining patch for v18?), but I believe that's how we've dealt with simil= ar > problems in the past. But maybe there are ways to avoid even these > in-development regressions, too... > > -- > nathan > Oh yes, I see now. Commit 18bcdb75 is just before the v9 patch got applied, so I used that as "old master" and compared that with master (v9 applied) and then "master (v9 applied) + v10 applied". arm NARROW old master 18bcdb75 TXT : 10997.568250 ms CSV : 10797.549000 ms TXT with 1/3 escapes: 10299.047000 ms CSV with 1/3 quotes: 12559.385750 ms arm NARROW master (v9 applied) TXT : 10077.096250 ms 8.369778% improvement CSV : 10310.671250 ms 4.509151% improvement TXT with 1/3 escapes: 9893.155000 ms 3.941064% improvement CSV with 1/3 quotes: 12133.064750 ms 3.394441% improvement arm NARROW v10 TXT : 10467.816750 ms 4.816988% improvement CSV : 9986.288000 ms 7.513381% improvement TXT with 1/3 escapes: 10323.173750 ms -0.234262% regression CSV with 1/3 quotes: 11843.611750 ms 5.699116% improvement arm WIDE old master 18bcdb75 TXT : 11825.771250 ms CSV : 13907.074000 ms TXT with 1/3 escapes: 13430.691250 ms CSV with 1/3 quotes: 17557.954500 ms arm WIDE master (v9 applied) TXT : 10568.344750 ms 10.632934% improvement CSV : 13046.610500 ms 6.187236% improvement TXT with 1/3 escapes: 12193.088500 ms 9.214736% improvement CSV with 1/3 quotes: 16629.319000 ms 5.288973% improvement arm WIDE v10 TXT : 9064.959000 ms 23.345727% improvement CSV : 9019.553250 ms 35.144134% improvement TXT with 1/3 escapes: 12344.497250 ms 8.087402% improvement CSV with 1/3 quotes: 15495.863750 ms 11.744482% improvement x86 NARROW old master 18bcdb75 TXT : 25909.060500 ms CSV : 28137.591250 ms TXT with 1/3 escapes: 27794.177000 ms CSV with 1/3 quotes: 34541.704750 ms x86 NARROW master TXT : 26359.319000 ms -1.737842% regression CSV : 25661.199750 ms 8.801007% improvement TXT with 1/3 escapes: 28170.085250 ms -1.352471% regression CSV with 1/3 quotes: 32638.147500 ms 5.510895% improvement x86 NARROW v10 TXT : 26416.331500 ms -1.957890% regression CSV : 25318.727500 ms 10.018142% improvement TXT with 1/3 escapes: 28608.007500 ms -2.928061% regression CSV with 1/3 quotes: 32805.627750 ms 5.026032% improvement x86 WIDE old master 18bcdb75 TXT : 28778.426500 ms CSV : 35671.908000 ms TXT with 1/3 escapes: 32441.549750 ms CSV with 1/3 quotes: 47024.416000 ms x86 WIDE master TXT : 26475.164250 ms 8.003434% improvement CSV : 31963.478500 ms 10.395938% improvement TXT with 1/3 escapes: 29671.120750 ms 8.539755% improvement CSV with 1/3 quotes: 40391.616250 ms 14.105012% improvement x86 WIDE v10 TXT : 23067.046750 ms 19.846046% improvement CSV : 23259.092250 ms 34.797174% improvement TXT with 1/3 escapes: 31796.098250 ms 1.989583% improvement CSV with 1/3 quotes: 42925.792250 ms 8.715948% improvement --=20 -- Manni Wood EDB: https://www.enterprisedb.com --000000000000a9ccbb064b9e20e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Feb 24,= 2026 at 11:48=E2=80=AFAM Nathan Bossart <nathandbossart@gmail.com> wrote:
On Tue, Feb 24, 2026 at 04:57:21PM +0= 300, Nazir Bilal Yavuz wrote:
> I will investigate this. However, please note that the current master<= br> > includes the inlining commit (dc592a4155), which makes the COPY FROM > faster. In my case,
>
> 1: current master without dc592a4155: 14400ms
> 2: current master: 13960ms (%3 improvement against #1)
> 3: current master + SIMD: 15123ms (%5 regression against #1 and %8
> regression against #2)
>
> Is it possible for you to do a similar test? I mean dropping
> dc592a4155 from the current master and re-running the benchmark, that<= br> > would be helpful.

IMHO as long as the difference from v18 looks reasonable, commit-by-commit<= br> regressions and improvements that even out in the end are okay.=C2=A0 That&= #39;s
perhaps a bit of mental gymnastics (e.g., what if we had committed the
inlining patch for v18?), but I believe that's how we've dealt with= similar
problems in the past.=C2=A0 But maybe there are ways to avoid even these in-development regressions, too...

--
nathan

Oh yes, I see now.

Commit=C2=A018bcdb75 is just before the v9 patch got = applied, so I used that as "old master" and compared that with ma= ster (v9 applied) and then "master (v9 applied)=C2=A0+ v10 applied&quo= t;.=C2=A0

arm NARROW old master 18bcdb75
TXT : = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10997.568250 ms
= CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10797.549000 = ms
TXT with 1/3 escapes: 10299.047000 ms
CSV with 1/3 quotes: =C2=A01= 2559.385750 ms

arm NARROW master (v9 applied)
TXT : =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10077.096250 ms =C2=A08.369778% = improvement
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 10310.671250 ms =C2=A04.509151% improvement
TXT with 1/3 escapes: 98= 93.155000 ms =C2=A03.941064% improvement
CSV with 1/3 quotes: =C2=A01213= 3.064750 ms =C2=A03.394441% improvement

arm NARROW v10
TXT : =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10467.816750 ms =C2=A0= 4.816988% improvement
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 9986.288000 ms =C2=A07.513381% improvement
TXT with 1/3 es= capes: 10323.173750 ms =C2=A0-0.234262% regression
CSV with 1/3 quotes: = =C2=A011843.611750 ms =C2=A05.699116% improvement


arm WIDE old m= aster 18bcdb75
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 11825.771250 ms
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 13907.074000 ms
TXT with 1/3 escapes: 13430.691250 ms
C= SV with 1/3 quotes: =C2=A017557.954500 ms

arm WIDE master (v9 applie= d)
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 10568.3= 44750 ms =C2=A010.632934% improvement
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 13046.610500 ms =C2=A06.187236% improvement
= TXT with 1/3 escapes: 12193.088500 ms =C2=A09.214736% improvement
CSV wi= th 1/3 quotes: =C2=A016629.319000 ms =C2=A05.288973% improvement

arm= WIDE v10
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = 9064.959000 ms =C2=A023.345727% improvement
CSV : =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 9019.553250 ms =C2=A035.144134% improvem= ent
TXT with 1/3 escapes: 12344.497250 ms =C2=A08.087402% improvementCSV with 1/3 quotes: =C2=A015495.863750 ms =C2=A011.744482% improvement


x86 NARROW old master 18bcdb75
TXT : =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 25909.060500 ms
CSV : =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 28137.591250 ms
TXT with 1/3 e= scapes: 27794.177000 ms
CSV with 1/3 quotes: =C2=A034541.704750 ms
x86 NARROW master
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 26359.319000 ms =C2=A0-1.737842% regression
CSV : =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 25661.199750 ms =C2=A08.80100= 7% improvement
TXT with 1/3 escapes: 28170.085250 ms =C2=A0-1.352471% re= gression
CSV with 1/3 quotes: =C2=A032638.147500 ms =C2=A05.510895% impr= ovement

x86 NARROW v10
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 26416.331500 ms =C2=A0-1.957890% regression
CSV : = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 25318.727500 ms =C2= =A010.018142% improvement
TXT with 1/3 escapes: 28608.007500 ms =C2=A0-2= .928061% regression
CSV with 1/3 quotes: =C2=A032805.627750 ms =C2=A05.0= 26032% improvement

x86 WIDE old master 18bcdb75
TXT : =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 28778.426500 ms
CSV : =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 35671.908000 ms
TXT= with 1/3 escapes: 32441.549750 ms
CSV with 1/3 quotes: =C2=A047024.4160= 00 ms

x86 WIDE master
TXT : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 26475.164250 ms =C2=A08.003434% improvement
CSV : = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 31963.478500 ms =C2= =A010.395938% improvement
TXT with 1/3 escapes: 29671.120750 ms =C2=A08.= 539755% improvement
CSV with 1/3 quotes: =C2=A040391.616250 ms =C2=A014.= 105012% improvement

x86 WIDE v10
TXT : =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 23067.046750 ms =C2=A019.846046% improvemen= t
CSV : =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 23259.09= 2250 ms =C2=A034.797174% improvement
TXT with 1/3 escapes: 31796.098250 = ms =C2=A01.989583% improvement
CSV with 1/3 quotes: =C2=A042925.792250 m= s =C2=A08.715948% improvement

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