Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iZh6A-00068n-6K for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Nov 2019 20:06:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iZh68-0005l1-IB for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Nov 2019 20:06:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iZh68-0005ku-26 for pgsql-hackers@lists.postgresql.org; Tue, 26 Nov 2019 20:06:08 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iZh63-0004pA-Oi for pgsql-hackers@lists.postgresql.org; Tue, 26 Nov 2019 20:06:06 +0000 Received: by mail-wr1-x444.google.com with SMTP id t2so23972478wrr.1 for ; Tue, 26 Nov 2019 12:06:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Mz3XoW4qLcRKXlRGBuoJlsQsqvw9UI9QvVuytWnPCXQ=; b=wzvmV5L+GuwY/b6YYGJA9XYukioloNFbd5S/bbdf4FOxpP11jSLrKObJRy2/F/eWlQ iKqwb70Z3oa8eGRM4zr1O7jxjI/kt/P1ddZsdIaEDjT2wfp4cx92THtdnaaiagKDzxVD M7Q213DUa+3cQ5Wjcxwm7OeUb7IGTG6rx+gYyUWB3PM+mRNViNUDEA+eWFnTjXEvTJyl s1g0XlJwVoR+dW5VfybkGlA9hlvBOCv0rZ5dN5bht1ln2Kv0agvssRAIXWpq5mh5wA9L Ka8q/I0j6KVKCdFXonRdMcOQZY84W/zh9yChGWw3nVsaygyPWdNlZgvUQGkTbSFAzj71 LW5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Mz3XoW4qLcRKXlRGBuoJlsQsqvw9UI9QvVuytWnPCXQ=; b=RSyu8KZ3wNZ66/OPfURks2pnUsPjvF27R4JP9oZIWmrKlbL0CzZFGKU2rpOdbdDvVF J0W2gCPR4qeYwGkKo7tHtOALPJPPbsBkGb/kKGqVEV8q1vr6jmpgF0SS7KLE+UTCXj3N 7OpOH1phgc7jqOusCe5nF+5LwMCEyRGU7pxVZUej7yKtjqUcrhTAqiXDXMMB14Upns6K u/Y1ZYR8NfW7O+a+Dr/Qh952+1wPsGp3QLIxxBYEn1wQBO9wJQdna0foThlF2VQquBSw 8meVW2fLBgXfVOXfbV6RlrCJ/iZt4mrvMyOQm/9LFBWEwblky4+nWJ3/9ylZse9IW3ti +TQw== X-Gm-Message-State: APjAAAV2S38uXVlLREMqhyJxX+8b61yetbG0vieM9nvLDZ/H58moHEQ6 dH0sAgUu0jDfRTKuwrrNbKPhfg== X-Google-Smtp-Source: APXvYqxpUR8nCStJlQzJx5kGHBXDAEMDHPfnMyONbvUPgrJ8YOq4aaD7YRLkHzIj3bSOw6O2UBbk8Q== X-Received: by 2002:a5d:6ac3:: with SMTP id u3mr4356382wrw.25.1574798762371; Tue, 26 Nov 2019 12:06:02 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id t16sm4448874wmt.38.2019.11.26.12.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 12:06:01 -0800 (PST) Date: Tue, 26 Nov 2019 21:05:59 +0100 From: Tomas Vondra To: Peter Eisentraut Cc: Michael Paquier , Andrey Borodin , Alvaro Herrera , Gasper Zejn , pgsql-hackers@lists.postgresql.org Subject: Re: pglz performance Message-ID: <20191126200559.7ol33csmuwl6la2h@development> References: <3c2d92d0-e715-f9ed-e1a7-3c510ed65940@2ndquadrant.com> <20191101154828.GA15829@alvherre.pgsql> <20191101165950.b5azncggaqfan5fi@development> <35c2a448-06b8-eab0-05ea-34a3f51ba9a8@2ndquadrant.com> <20191125080309.GK99720@paquier.xyz> <13C6049A-C3D9-4021-9934-41488DE38BE9@yandex-team.ru> <20191125082940.GP99720@paquier.xyz> <20191126094324.7y2n3n3houetavwd@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Nov 26, 2019 at 08:17:13PM +0100, Peter Eisentraut wrote: >On 2019-11-26 10:43, Tomas Vondra wrote: >>In general, I think the results for both patches seem clearly a win, but >>maybe patch 1 is bit better, especially on the newer (xeon) CPU. So I'd >>probably go with that one. > >Patch 1 is also the simpler patch, so it seems clearly preferable. > Yeah, although the difference is minimal. We could probably construct a benchmark where #2 wins, but I think these queries are fairly realistic. So I'd just go with #1. Code-wise I think the patches are mostly fine, although the comments might need some proof-reading. 1) I wasn't really sure what a "nibble" is, but maybe it's just me and it's a well-known term. 2) First byte use lower -> First byte uses lower 3) nibble contain upper -> nibble contains upper 4) to preven possible uncertanity -> to prevent possible uncertainty 5) I think we should briefly explain why memmove would be incompatible with pglz, it's not quite clear to me. 6) I'm pretty sure the comment in the 'while (off < len)' branch will be badly mangled by pgindent. 7) The last change moving "copy" to the next line seems unnecessary. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services