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 1sc8oS-004IFg-OC for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Aug 2024 19:28:40 +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 1sc8oR-00GbtB-2C for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Aug 2024 19:28:39 +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 1sc8oQ-00Gbt3-P7 for pgsql-hackers@lists.postgresql.org; Thu, 08 Aug 2024 19:28:38 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sc8oO-003qcI-1l for pgsql-hackers@lists.postgresql.org; Thu, 08 Aug 2024 19:28:38 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-81f95052c2cso55057839f.0 for ; Thu, 08 Aug 2024 12:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723145314; x=1723750114; 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=pGnO/4td6LPX7sf7ZysCh6zkdIFSAOJuWMbuozg2wTw=; b=UKveaPJ01H3UcxgDkipENddv4eBlmvl8kuplgJpKMqFJm8s6NYiRStk/XCtfwtkERq pOhAwuw59HbLe5Icp7cTh/FxX/FazsPOHf2bqU9DDnh8JRcqM5VkgeP1qzm+FbyuanmC LJqNDrR55dz/qRnc/wrETnTrqLvNiN4X/u5lTqUNGJ/cTzHQoAa5dOTDiSEDErbVVK1h pBIHHB9fT3IDtSUMjpKSgrfRF3XDmKJngDToEcOuUC12Ub4LjwRzZFyTz93vQ7fqZRHF kzeGslPM/RuW1YOZ1Ix0PPjwEDEACvFJaEfs1YPKCvHp9RYIPWmG5D0k6ZDuX4nn6ZUW Sg+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723145314; x=1723750114; 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=pGnO/4td6LPX7sf7ZysCh6zkdIFSAOJuWMbuozg2wTw=; b=GiHewMRNrPeoCZK8LoZa1tkfbYdKf/Tso2cXWABQdPgRGxAp/4VQS8fhRjn3lviqwH bQ8zLq/+YATgjETtUbwjaaByP11QbOWeA/wOAlUEISX6UC4/av0x0DTZk+EAvO9stgk0 Fk8jW6W+OgTROOeg/wTdATtflnJoBruAq15xVkhEcSJJDY4F8eQelTyQaTvJnzlAHEB/ Im9JPyWejHfAQKU3hHS7SOtPjkkR0G0LwZpBv2rSmaVEBCd2fxfp9WQs4pp9igFfw4Bt bBjxKGltlDpnB8csqBZRzMe/sNSbVNV7l5FUPq43NV5unejdghiMUvLShaFlYgGBTZyM YqxA== X-Forwarded-Encrypted: i=1; AJvYcCXy7vFaRWcR1rBiVui9/dKPXjZ9eUgEe+uCZtd57f4STGY3oDRHmgnBH2dtD9sORs9uDxmlaV/YeFeHRXG1J9dm8JH/OMstwnUJNfebbSqQ8U4m X-Gm-Message-State: AOJu0Yz/iAEbMzky3Zoe3MPrJfDolxZtcqs6FEMdt9UE5b/tBkJYkStW uXCD4gZefo+9+SIGMKYgmg1979/vUnN3BYm+EeBAa3LGDLh2/X7/ X-Google-Smtp-Source: AGHT+IG6JpsOZI82zoBz/gGdFLyQRi2fMwt4uU2C9ldbWqb8TDm11v4t+xbrXbpNIw0o0fG48PKX3A== X-Received: by 2002:a05:6602:2b8e:b0:804:2216:4b23 with SMTP id ca18e2360f4ac-82253831e06mr379987039f.17.1723145313717; Thu, 08 Aug 2024 12:28:33 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4c8e30544b0sm3030749173.85.2024.08.08.12.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 12:28:33 -0700 (PDT) Date: Thu, 8 Aug 2024 14:28:31 -0500 From: Nathan Bossart To: Andres Freund Cc: "Amonson, Paul D" , Daniel Gustafsson , "pgsql-hackers@lists.postgresql.org" , "Shankaran, Akash" Subject: Re: Proposal for Updating CRC32C with AVX-512 Algorithm. Message-ID: References: <20240612193746.rjeiip4hcamjedgo@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240612193746.rjeiip4hcamjedgo@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 12, 2024 at 12:37:46PM -0700, Andres Freund wrote: > I'm wonder if this isn't going in the wrong direction. We're using CRCs for > something they're not well suited for in my understanding - and are paying a > reasonably high price for it, given that even hardware accelerated CRCs aren't > blazingly fast. I tend to agree, especially that we should be more concerned about all bytes after a certain point being garbage than bit flips. (I think we should also care about bit flips, but I hope those are much less common than half-written WAL records.) > With that I perhaps have established that CRC guarantees aren't useful for us. > But not yet why we should use something else: Given that we already aren't > relying on hard guarantees, we could instead just use a fast hash like xxh3. > https://github.com/Cyan4973/xxHash which is fast both for large and small > amounts of data. Would it be out of the question to reuse the page checksum code (i.e., an FNV-1a derivative)? The chart in your link claims that xxh3 is substantially faster than "FNV64", but I wonder if the latter was vectorized. I don't know how our CRC-32C implementations (and proposed implementations) compare, either. -- nathan