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 1vszuS-00DmMU-0z for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Feb 2026 09:01:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vszuR-002uL2-0n for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Feb 2026 09:01:19 +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 1vszuQ-002uKt-33 for pgsql-hackers@lists.postgresql.org; Thu, 19 Feb 2026 09:01:18 +0000 Received: from mail-dl1-x1236.google.com ([2607:f8b0:4864:20::1236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vszuO-000000007BY-0GZ4 for pgsql-hackers@postgresql.org; Thu, 19 Feb 2026 09:01:18 +0000 Received: by mail-dl1-x1236.google.com with SMTP id a92af1059eb24-1270be4d125so1296483c88.1 for ; Thu, 19 Feb 2026 01:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771491674; cv=none; d=google.com; s=arc-20240605; b=a3N9xNjkFKP5ChtG001H7YIV1yL3J/Vz7r0CGD0kQIV6wQkJ0AEFpU5PoUCrnFUzIo N6ntTU9gdHRmla4AOIWOyQ/1nZSDTYC/Tffh4K1QCNLc+WbhgLFYDTHkvw2cx+hM9SDd 8q6DmUGGF2yKn9AgbWwI/+bnXy7mxxyf3NbiFkrqCQCycQ2waCzbMbuNGuCTCVROmidC s2lFsyA76P83+3J652WQBPbVDG7fk+PpLvqHeICmnaRsLwyNS4tRtKM42vEotCX1EDkD 6fuZCMorYvsgGTNE8l2rnw8GvLJMfsSb2uJUdghNFko6VId7Q4em3wLpwYj1ttwU12Yf QTGw== 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=IvV2Aw7idMN2FRJnyS4bsRu9UxyPC99A+K8QAplg+nA=; fh=8bBlpVk943LywTRPHNDgDuHp90iqn8i/GiucoywLygQ=; b=ldcwRQFSmzgeYWkSmBGz/mAuGJ4w/p9/2OlrmufbVPGjHGSJ6/XAjJEHDOZ6UwyWow PAS/9EJAGSZzxMb1gs9b9zWKsYIGkrWdsNSg7OHWJbguck/GNHw90gxWMs0j/61nNunA H07HMxtl860H/UsQ3FOM0edo9MV64ZO0Spvk3NKfBpZyCR4WHvqhTZKgvNwA6ZuDp39E HSCCz6zIOZa+ObXg2YAf50MpEEiwNCb85Gsrm9eYxo60foE6t/7WhyesE9eSsvpqtyfF ovyrmTsoIOcMgdAhkzlLAtKTg4b+1dnfYdEy9ZrjSQLqL3wt/OOjfKN3kO/fQG2bjdGB 8Rew==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771491674; x=1772096474; 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=IvV2Aw7idMN2FRJnyS4bsRu9UxyPC99A+K8QAplg+nA=; b=cdge0BHAKECynNPgBw5PN00XIpv0FxMpd/KCJP1ZCJ2pwfGdJC8o18OxlTE+d6w8JG mLs2LUKvyxWdthqjH5Ocutwf57xvvE7X2/QmW3o2/hcyqrJIWTjBAF6UCLySJRXK0fku Hu/FByLNcO8dxPsFbTasxPBdV93FKr3gv+rUy5qYOypDzbrLn5/DoyXdk00WxjEwX9IA XjDjd8mYanmB/ZmUdYG2/UF160j0Tp88gHUcLS1Lcmj763EiBne+bj6t3R8UkP8nWWks /KnsCuRFJ4GXIOQtUdAUo0IPj0vAepc75M2zcZgFJh8E9m+QGnGgaYaQNg0ctucNJpTe yvEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771491674; x=1772096474; 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=IvV2Aw7idMN2FRJnyS4bsRu9UxyPC99A+K8QAplg+nA=; b=jfgOdBj7d9/V649S2qXja/cGornfri3LrPNqM9OdCBbszkQHXFK2bobQulJ8u/WQ6V ytgpPRSTePBLKBJH79twqP2cJQhFU3dnK6x0LM2j07D7onRIxCxPDmb+DTMjhn2SRMrt B+mFA7MSZ8+iTRnxKaICtER7Iolyx8otoRyGyZWInPp2iWCFjAin2ZdPDyYkC5SRb2V7 NgVcRiT0mNFuMIPh7j/zCLNwGho5SNLlbanMDj6OZownFO1tLv7r1uinH9KBj0+ekfo1 rmDcBVfNSdBK6fFM4H9zQqyBUjPN+ZCGg1MxEmxT/2I0L9OV+eEt6CM9ff1h4Q/atFfk cwnA== X-Forwarded-Encrypted: i=1; AJvYcCUQYtLwesb9d/3a6mHEF0Dq18YoyFdxOvop2CNCoBrqvF8kbL+9xbNITtTtLy33u1WIiMOhGkBUngihE9pS@postgresql.org X-Gm-Message-State: AOJu0YzMK9L1e30YsXZT0QF+ZKjMj94HP5467L4PVIcRNC0gCszB5RRz Bu8/mEuQ+YPgR5+D/6Wpz1W2qzO8nq2d3vIafPjgKfcZ2UV3LnGvJDyB1I0wCQ3j9QuILoXpFbn E2EFKuhQecgErPmnNgP0T3VgPv+twK80= X-Gm-Gg: AZuq6aJFyq6FHiyW5enpyWqWKCw/1KUSSYijr3Z8atU/RwQlNLDlFtS5IKH3Sr3+8qi UG8IL/xYX+gG5dcpUQNhx0Oh/ofhJWiaHJvc2UE4pMwih1ckblohX6uh7zqaj8uMFEWYk2NjwvW pCMgXLEThJA+ySH64hdyzRBrpHr0e952blKepRcI2X6HEXQ9D3dudrMqr6xARhWHowDR5+lQfu3 HVZ4tRePk1/o1ZDPHrZIF2ODbiMHpQQsf+BXYMiqzuB53eQybx9cz9UwNFCchzCykEIR6jB08BG Jbbu73M= X-Received: by 2002:a05:693c:2c85:b0:2b7:97a:75fb with SMTP id 5a478bee46e88-2bac9342a27mr6360350eec.11.1771491674013; Thu, 19 Feb 2026 01:01:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nazir Bilal Yavuz Date: Thu, 19 Feb 2026 12:01:02 +0300 X-Gm-Features: AaiRm526WxEQeH6rRjdxm6I191bira1z0VyQjkIlT0pOHf4DuzTkoseRj8KkC60 Message-ID: Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD To: Manni Wood Cc: Nathan Bossart , KAZAR Ayoub , Neil Conway , Andrew Dunstan , Shinya Kato , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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) on 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