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 1rqF5m-00BLcv-KH for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 16:28:35 +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 1rqF5l-002qlM-M7 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 16:28:33 +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 1rqF5l-002qlE-Cu for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2024 16:28:33 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqF5i-007Jnz-Cz for pgsql-hackers@postgresql.org; Fri, 29 Mar 2024 16:28:32 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4V5m714xWbzyQn; Fri, 29 Mar 2024 18:28:29 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1711729709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVq8cenViTKkzryklK6DlH4AuGv0sdccs3d0c3Uqf1w=; b=lOfFs5Mr1uuMT25qqVXr2J+HEjAlfp5FIqakJfwK2G4wnlCEXa3DkXYtIbYVN3CIzllK7r mcnn6fBvf/7Yq7vivYZcfwOLffHVYXIe5ag0eWKXowxer/6byNZv4z5HKrEhEWHpDzAW3h 8Ag8vR156Fe/21cijJYPnb0Qn8EgoRM= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1711729709; a=rsa-sha256; cv=none; b=sK81yWfxGCZIJP8P7tFo32/Hi2KZ/pxyFS8g4h2lGvWeDd9m2UY3b6SHtlDkVM4l8dkg5V wd7T9YxlgULHgkt7fK92Ir4rRMm2wtGiNcJ3+AnR2T9rqf9o50iN0NHUokca0oeXZiMe3q /LretFqg44CV03zJcnxYfPDCISv/tdQ= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1711729709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVq8cenViTKkzryklK6DlH4AuGv0sdccs3d0c3Uqf1w=; b=n6TbMviZjdhcbnJ0xmuo3C8HiL00FyMmMo6Orl/eRTIOZI+n4QfEoX99rSEqKeJMAXiIbw 6R+EHMbrelg/PeQhufnpNmrI+BBEhKs1gxZI77CAnNS+wobEIVOn6i+LUK3MnHPnrDK2Gw qp8pz1QKzp9H1/8dxs3lWH0NasHgB7I= Message-ID: Date: Fri, 29 Mar 2024 18:28:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Streaming I/O, vectored I/O (WIP) Content-Language: en-US To: Thomas Munro Cc: Dilip Kumar , Robert Haas , pgsql-hackers , Andres Freund , Melanie Plageman References: <56bc4ac4-9a9e-4f28-af1e-b6d537bd9a5e@iki.fi> <289a1c0e-8444-4009-a8c2-c2d77ced6f07@iki.fi> <98f01395-fc60-4d50-89c9-fc3011fa2a45@iki.fi> From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 29/03/2024 09:01, Thomas Munro wrote: > On Fri, Mar 29, 2024 at 9:45 AM Heikki Linnakangas wrote: >> master (213c959a29): 8.0 s >> streaming-api v13: 9.5 s > > Hmm, that's not great, and I think I know one factor that has > confounded my investigation and the conflicting reports I have > received from a couple of people: some are using meson, which is > defaulting to -O3 by default, and others are using make which gives > you -O2 by default, but at -O2, GCC doesn't inline that > StartReadBuffer specialisation that is used in the "fast path", and > possibly more. Some of that gap is closed by using > pg_attribute_inline_always. Clang fails to inline at any level. So I > should probably use the "always" macro there because that is the > intention. Still processing the rest of your email... Ah yeah, I also noticed that the inlining didn't happen with some compilers and flags. I use a mix of gcc and clang and meson and autoconf in my local environment. The above micro-benchmarks were with meson and gcc -O3. GCC version: $ gcc --version gcc (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- Heikki Linnakangas Neon (https://neon.tech)