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.94.2) (envelope-from ) id 1tpr2t-00DGQw-CC for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 15:52:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tpr2r-00En4t-Vq for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 15:52:30 +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.94.2) (envelope-from ) id 1tpr2r-00En4D-L1 for pgsql-hackers@lists.postgresql.org; Wed, 05 Mar 2025 15:52:29 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpr2o-00180d-0W for pgsql-hackers@lists.postgresql.org; Wed, 05 Mar 2025 15:52:29 +0000 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3d3e68939deso3317195ab.1 for ; Wed, 05 Mar 2025 07:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741189945; x=1741794745; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gHFcgS4nwk68qQsQD4cV+9gPoXGP+lPaWU13Cl7eFhc=; b=Kj2IG438jXRQms8hJ3YiCp4IckLcBlzCgesW6McT9Xk45d/DloQJ8natRmMPFQlq+/ pXOsixL9Eyd48KqgWeBSzVhsLhAIZO7QjcCaOX7Bs6AyGH6R1zL81KE0DDDSwoZoBY3F SNho+owu3Ml/fyTehhwYHj5ragH5KgF8G8fdv3+sFg2XdRrwTMsbwQzHmx1TijPqCPD9 wRvSwpEF3ytQzRwa0rzPiO4FGMtJWm+zU9Ah1eRqRZyN2C+Q7qulBTZZD8Vm6f25q0tp oQUUCEDBJXfi+MAhOF6s8pUmFCTvMOuWBAIIS8c/94rP/9rcgQMn/AXsMCKj62QyBZj8 Zl/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741189945; x=1741794745; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gHFcgS4nwk68qQsQD4cV+9gPoXGP+lPaWU13Cl7eFhc=; b=cPUYGgz7xZjDFx62p8L4T9UyMWxhs0P9T6bQixkF2peuqv52oFuZNidvUQ4KzHNug3 VSEnajL9PXzvkuqIZ69pPIpZyvc+FVIf+td8ETp26ArJGtS82eYEbQEFQCNlLfb78Y7W PNZAFhZh4ypL2wQbRkeCEODWnykPkz4QkxJeJgaEttB4ZYQb8elC423xvokTUDD/fiK1 4hgOvubk5ZRoYhC+mZF0Mv9fwJtI8tFGzja5g3bmp3v0fm7bop1uYazDlQqtXFD0fKc3 wQEr6EdDqimAfdYIR98H0Eg2sZgy2UMJ3HhszN9nmQ8d4cnDLn4f27GKuOX1HonMacho qEIA== X-Forwarded-Encrypted: i=1; AJvYcCXtcwSaohPPDoDyyuYMYMUG+lP6TIHpwmANmMhQ/G+yZPeQnyP9pMHVnM8xldnD9LV5LsPXO4VzS0JdPbX6@lists.postgresql.org X-Gm-Message-State: AOJu0YzIXjAXs9z7lsnqnWRAWFFn/ovKfatyizbab0iTA5HfN1uWzgrY pwCV2KJMsRsGtvXBq5JZsF3e1jRQsfCEHuPTbTH1q9D8J2MCGERu X-Gm-Gg: ASbGncsONTy/WtWDtnAu4rnZGkYEnmKrMnNecmF60s///UPprPtUqwQI8vREcEbarg0 cO4kMlFX7eZwlHyMZND7hRGzCu3893uvLhQHp7PHrkv/B42bXSVHiVbWsJGQtIEV6ViB/4ogJdi zb2yU+WlPZ3YfI7O4J6ZP0+IKVa2arSyw5QxiBzdsvS+gmsRj8c56JbKM9TQc/TfXkygduqmmvr aGyzug9pHbrqMMg9QQ/OROk8yCbQoFpfRrWK10XNNVQrHR/sSYHDeyGmnXTPBm85grFqX8RURZ6 xVZUaUxpeFws5CMOSfY1uoqVErSViKT9FUk2sAYJZ3/MMAYGotcIuQo44/Z+hT+Zl0DQqkGd9td fQVVprYCZG0CUx+P4O2olg9PCYqoaUbnjV08= X-Google-Smtp-Source: AGHT+IHQXJYZ4H4WNoIO3qrSyW5hQZr907wkYrZfmzxohNISLMv198DdpEOAuEk2sMae/IGKltmcEQ== X-Received: by 2002:a05:6e02:184b:b0:3a9:cde3:2ecc with SMTP id e9e14a558f8ab-3d41dc558e5mr92176395ab.6.1741189945559; Wed, 05 Mar 2025 07:52:25 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4f1f61e8117sm579676173.46.2025.03.05.07.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 07:52:24 -0800 (PST) Date: Wed, 5 Mar 2025 09:52:22 -0600 From: Nathan Bossart To: John Naylor Cc: "Devulapalli, Raghuveer" , "pgsql-hackers@lists.postgresql.org" , "Shankaran, Akash" Subject: Re: Improve CRC32C performance on SSE4.2 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 05, 2025 at 08:51:21AM +0700, John Naylor wrote: > That was my hunch too, but I wanted to be more sure, so I modified the > benchmark so it doesn't know the address of the next calculation until > it finishes the last calculation so we can hopefully see the latency > caused by indirection. It also does an additional calculation on > constant 20 bytes, like the WAL header. I also tweaked the length each > iteration so the branch predictor maybe has a harder time predicting > the constant 20 input. And to make it more challenging, I removed the > part that inlined all small inputs, so it inlines only constant > inputs: Would you mind sharing this test? It sounds like you are running a workload with a mix of constant/inlined calls and function pointer calls to simulate typical usage for WAL, but I'm not 100% sure I'm understanding you correctly. > These are still a bit noisy, and close, but, it seems there is no > penalty in using the function pointer as long as the header > calculation is inlined. These results look promising. -- nathan