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 1w7QTE-005IwA-0R for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 04:12:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7QTC-007r6Y-2G for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2026 04:12:51 +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 1w7QQ7-007nnc-1x for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 04:09:40 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7QQ6-00000001uZZ-1S8G for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2026 04:09:39 +0000 Received: by mail-qt1-x841.google.com with SMTP id d75a77b69052e-50697d6a69cso27590501cf.2 for ; Mon, 30 Mar 2026 21:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774930178; cv=none; d=google.com; s=arc-20240605; b=cmGn07igRUHq3liO1CX4znV9cOMISJXLZNUPIGl9oysmqu/3Xm8AOj1YG12B4pr7hD MPwsxEIrvviTFgsOgj5QnRCWInlrUI99CII0GCoaaNg/1AaFFG29BgYkQDRbT8MJUBOm UyglEcfjRDyakyOZY4G93/UKZrqAPBlnH3MFo8/W/PlhbSoKQeWC1lg/ICNT8kU4/2b1 b6PclTorxfhi3fsqapcaHMfVAxHOIfzrQHKR6Q5RjVMl15LukqgRKVM5JnIlpOyAR6jt NWXhi2Wv8xTPkbC3WyLaqbKgKcaczpD798BFgH/YNcF32GPmj1J8DKkbnu4Pv6B9Jlzw zgoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/MBV28d6w5G0KEGrtjK97QUblg0SjtymOYqUadf6QKs=; fh=Yr+eAEZUpRAF1fPdDvIQ4RHcMKs9+KxdO2Q9qYQ8gH8=; b=cNSlXBUGW1yr9AK1T7USXEYkOo4vXg3n12RZf8nfzLIl6v0sXBocqCmu6ZZhVw1pm6 t704HJ6J/cSzPuQD36hf0gc84rqTiqtcCIx5mGq78DcPYggduBrfCR6s2nGnXKXtvin+ hVQwc3t6jP269CzTFjumqfmXTed6h4zSZWpcwS1XcERTW5ImKMLX8AwOrTfx+8iI92l2 1UozhLbFVDcbH3xKfSG7FK0b+9rvho7JT+BSgToZNPIswq4hoEoZ4wm0yeRpXLx2c4bF DZ5yZde4Acd+cG2+cW62L/RzYzSb0DFNZ8QnyaEJg7WT45r/y88HxVBi0HFRlnKgz1Oo gNnA==; darn=lists.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=20251104; t=1774930178; x=1775534978; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/MBV28d6w5G0KEGrtjK97QUblg0SjtymOYqUadf6QKs=; b=S+OBCiED97Scp/Ahw8x8lBLOsRIazkRJcj83bWcbND8vYG7hTAPr9FXKkiWfvhbcv2 6xtl8dPjzwsp44YuHqAh/L+ZpCzoDtHpSOZAiiwiO/76fnGZR3oSqU6trFDxf0m6PAdx dkINQQRn6btDF0fQ0VWUHegcxlNprj32THa0mLH1aVY78RYwwah/UtFQqU1dnYiSQ8B4 i+T8RJzcjXZswtEDQv0eFsQg7jxTTUNP/hMAn2RJ9xPwNJH4xwc319W0uoyMJKzfZmbK klui+YT+fpYbSDSPI1D3FpIB7OahKu3TAgZa+u1lRV7504neFqj7DBZZndqBRnfOkt1f qs9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774930178; x=1775534978; h=content-transfer-encoding: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=/MBV28d6w5G0KEGrtjK97QUblg0SjtymOYqUadf6QKs=; b=nL/lb/v8Rz2gxKzHEizGzFvInHYRBFrUe7vi0gHrLRTz02yChVVWb+O+8Mmc4AI/Ox 2KyNF0ggnsedB8594Q77bjK46sGuO8SOW4RLItcCMPIadY9O4OGt160xYkk4bn8An/BC 3p5pMTil9CNJhyKhmErUzdk8+AqBEMTFBlTgf1V0NXJ09dIwsIklbHOA42aiUD3hjJz1 /yWr76aTbgvmO7iq0d4JJ+7UgJ9qcXhidf+bSLYbJ1rwgAJ/ANFhJn9DnwZEDJpz3//D mpKo3figoxHedQu4GvOzHA+lwDXFSnAJEklprzOpsYJwpllKp6pp6RNJ4oX9shrZ+fhT fXtQ== X-Forwarded-Encrypted: i=1; AJvYcCUI+Y4CMgE5HWjDileBY/IuFPFm9OqAkl641r9zHsZ68Pxnpz6AZ73qmlarWkm7LfX/v1GuP2NekoTtyM96@lists.postgresql.org X-Gm-Message-State: AOJu0Yw2lRGPHGPTVTDiTHkQMLW0Sr91YCEqeoJEtTjg5Yd2dsXBDoOW 0GJFmLm76IDzdclLJyGrxCkrK2c4pXJlw05CUrik7m7t4T0oCOOXj4EJmLhewcbPo6PSh8JTLSe M8Js0YuWJLzshlc54WYFtKQv1Mj6s5Zo= X-Gm-Gg: ATEYQzzvmYVJZsrKOhp6u6tu4w5AWEHlErxDfaIEaeLfw6meUdD78BeWQXjpsNeTw9a B6G4ZhDtyNgc3Lv1B9T4rZZmcXyXYWO4N8ptg3ujKfSMkCsIK00FPUbT3C+90s5Mu97PBSB8yXA P9kqW9yQekBk5NYx/gZ2ivoAH40a40qAhJJFOs9kcoECH2WhhuBHl0+VmXs6NX9rqJJXDwni8kl SIyevWCPr+gVmHyVwCPp844obT1PyD7qQvj1JyGr9HYsYVvUYMRvwHg4O4eKeyz0Bev5FAAu9n8 o94z30AcW8QOZCQ/tHjV/ATiVz3TWL0kFxS7EXyyZ0vy6E4ASGwOzv0TO6dJJTeSlB+8MoAgdI6 twpYtVa9CQSM1YhazPYAVzBWI5fg= X-Received: by 2002:a05:622a:147:b0:506:a624:1939 with SMTP id d75a77b69052e-50ba394d803mr206244361cf.51.1774930177694; Mon, 30 Mar 2026 21:09:37 -0700 (PDT) MIME-Version: 1.0 References: <20250911054220.3784-1-root@ip-172-31-36-228.ec2.internal> <0be1b7b05726652ea0d83e8f72fd4cfe@postgrespro.ru> In-Reply-To: From: John Naylor Date: Tue, 31 Mar 2026 11:09:26 +0700 X-Gm-Features: AQROBzDBQmwXvi0FZrLwMwIy3kvNhnKhAFNNxy9wuoPXN93LLNV8r97wMHkg7N0 Message-ID: Subject: Re: Proposal for enabling auto-vectorization for checksum calculations To: Ants Aasma Cc: Andrew Kim , Oleg Tselebrovskiy , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 30, 2026 at 10:01=E2=80=AFPM Ants Aasma wrote: > > On Mon, 30 Mar 2026 at 15:01, John Naylor wrote= : > > I don't remember the last time anyone did measurements, so I went > > ahead and did that: > > > > master: 945ms > > 32 AVX2: 335ms > > 64 AVX2: 220ms > > I'm guessing this is on a recent Intel. Any extra width is helpful on Int= el as they doubled vpmulld latency from under us after we had settled on th= is algorithm. It's actually ancient and due to be replaced soon, but still several years after the adoption of this algorithm. > FWIW I think AVX2 (x86-64-v3) is fine. Glad to hear it, although the patch doesn't use that build flag, so it's not impossible there is some additional difference in the compiler's model. Still, given the variation you found, I'll make sure the commit message says "several time faster" so it's not specific to my hardware. -- John Naylor Amazon Web Services