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 1w4mR4-002Y50-3D for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 21:03:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4mR3-002QRm-1R for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 21:03:41 +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 1w4mR3-002QRc-0S for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 21:03:41 +0000 Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4mR1-00000000gT7-35Ol for pgsql-hackers@postgresql.org; Mon, 23 Mar 2026 21:03:40 +0000 Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-56ce54c8c82so199727e0c.2 for ; Mon, 23 Mar 2026 14:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774299819; x=1774904619; darn=postgresql.org; h=in-reply-to:references:subject:to:from:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rntcHOsidz/9BSqpU/waDmO9fJp6/Z5IM8tsmcAJTMA=; b=kdROHFDHRACo87w4o+3xdyo5MFV/H9W7FsCkXqayIYB8DXyNVtJ2jD5AdTWpxbQjjK lucS+j1ImolOUE/ftj7m0Q8o+n1vapJKAzD5woDMYMdEipUoQnCEcDU0ZiM3of/ym2Rs 53OlWo+VJABy2Jn1fDZozAgtSeXG6oQ6aVHfXDqVwY0aJhQVvJ4ZVraoPkyf8XcCBDPr j85KwDPQNgtlRtGTKCS1K4LK77Kjy5DaYYtxd+C6jg73yTa93dcuc6+v29HP978LsMV2 /ABnIM2ukgYu2wMR2Ru3Mjw4r4jSe94H6tcevA1HjbnDD5E1FBM4haDAfzsmTU7uZ+R0 oB0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774299819; x=1774904619; h=in-reply-to:references:subject:to:from:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rntcHOsidz/9BSqpU/waDmO9fJp6/Z5IM8tsmcAJTMA=; b=A1+m1yy5kB9joYxa9PV1zP72bB7687C4fQFaE1QaMKrwML0mh2cJyVFZOBfNuDEtPu KcKY7TP36DssraceLI1eRCRJ0hDkQxRktZQl6ZnCcal46ZRVKUSm8PCiO4hjCmlnriB8 UTZTk94ryR1atZOmS+JEbP/vr3PT4Vm/AuYJYUAJELzYkFx9MzFA9ON/SmywiyGO7OsB GEWYelEPP8iJ+VISrEXTaqfqHbBSMqBUnWDcwCyvYfRjzv9DZ7coWzDNP1mo85RpDrxn 4Nt6JeJMo4Zfg+eZU5mxVQd1/mLvQbu8TTsYLbZ33oxwDULMnXpYl7ndIwz5MAqKn526 l2tA== X-Forwarded-Encrypted: i=1; AJvYcCWqGfZwk/k820sA98PBO5x78KfgJmT+tEe/5J1Tg64vZhSUQHqJzsbg5BbB0hyYmFa+2cGEPzUGHNpL4IZa@postgresql.org X-Gm-Message-State: AOJu0Yy79dq8+Z76GjgPYQsTzFXCOdG2GXuB6VKMbCLXF6rQzJrV0ykW IT3mgOAuHpDQIMPnQmXttsettodnM7mVk152lquFpQYvESwUkaUE/ofG X-Gm-Gg: ATEYQzzLEkYjpAIBpvAme55Doo8mybiwcZtHawvvQYp0vIsvESC/Nolwu2uNhk22zbI hJ7Az3I6Oai7aBHQBdVpjH0HQTvP+tErXNdFC6yZEHF/xB86K0q12MPW8WBfGLfLlWF8xtZ9Kh9 HGoEqyNhNlQWiC0R2qOSxxmUho4YYjv0gaBcaIn04SFdqewAgVb7qKZMpxTr0SSyh9KYiOcQvQB QcBPl5z33QFs6fggaiCR19Mc800qKcLi/YrDIZDw3kfnoZTkOS0FPdnIZkO/oCkl2kpDjCzpTNW sk8fjsPi8Lt2FrahD8h/EqQmIKvkzQ6ZhlrOFtnRGY0QrzlX04Eb26feF5mElhXB8gJf8TREJsc Lj18SU1oneEGhJs8REb2ctN/4Ex9+/Qb+Zp4ZYYJ1I7+y2jtzuL4NkFhE+uxXcnTWIGK3a9S9v4 +2sR1C3dtsln9gk+QR/wvzVcmGXRu0wkrt1Te5nOamvXUcsY4Yg5DRkT4= X-Received: by 2002:a05:6122:e153:b0:56b:a6b4:5902 with SMTP id 71dfb90a1353d-56cde43a7bbmr6436763e0c.16.1774299818928; Mon, 23 Mar 2026 14:03:38 -0700 (PDT) Received: from localhost ([2804:14d:328a:a59c:3c4b:82c:d5bb:f03a]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-95136de3e33sm10444869241.9.2026.03.23.14.03.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Mar 2026 14:03:38 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 23 Mar 2026 18:03:35 -0300 Message-Id: From: "Matheus Alcantara" To: "Pierre Ducroquet" , "PostgreSQL Hackers" Subject: Re: LLVMJIT: introduce force-inlined functions X-Mailer: aerc 0.21.0 References: <0ZWNQh_SmV9oIbQW9PIXIfsTPKp6-7glTtLq-jntPv9orZTvG-XTTnvDkyrB86TqEWbNCmDqJU-MIZX3QbyuWtALC7mhZGPjMrCg1pxoyYk=@pinaraf.info> In-Reply-To: <0ZWNQh_SmV9oIbQW9PIXIfsTPKp6-7glTtLq-jntPv9orZTvG-XTTnvDkyrB86TqEWbNCmDqJU-MIZX3QbyuWtALC7mhZGPjMrCg1pxoyYk=@pinaraf.info> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I just found this thread when searching another thread, thanks for working on this! On Mon Jan 26, 2026 at 2:23 PM -03, Pierre Ducroquet wrote: > Hi > > A bunch of functions are the most used in queries. The llvmjit > inlining system (tries to) get rid of the overhead of calling any > function, but this is triggered only when the cost is above > jit_inline_above_cost. There is thus a nice performance boost to have > by choosing to "manually" inline a few specific PostgreSQL functions. > In this first patch, I've chosen to inline int4eq, int8eq and most > date comparison functions. They are definitely small, the generated > code is not bigger when inlining them (surprisingly, on amd64 the code > is even smaller) and are unlikely to ever change so there won't be any > maintenance burden here. On my AMD 3900XT system, this gives me a 3 to > 5% performance improvement when running 1M dateeq calls. I will likely > submit a second patch version later with more functions implemented, > but I thought this was an interesting first result worth discussing > already. > This seems interesting. Do you have the planning time comparison with and without this patch? Wondering if it increase with this inline pass. Do you still intend to send a v2 of this patch? The current set of functions is a good starting point IMHO, what others do you have in mind? (a pgindent is welcome for easier review) -- Matheus Alcantara EDB: https://www.enterprisedb.com