Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111701 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63598 invoked from network); 28 Aug 2020 08:15:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Aug 2020 08:15:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8606618050B for ; Fri, 28 Aug 2020 00:19:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DOS_RCVD_IP_TWICE_B, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from box.beccati.com (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 28 Aug 2020 00:19:00 -0700 (PDT) Received: from authenticated-user (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by box.beccati.com (Postfix) with ESMTPSA id C5BA620030D; Fri, 28 Aug 2020 09:18:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=beccati.com; s=mail; t=1598599139; bh=YJWtIIzUV4TdItFlBS8wVQmYR/GLJ3e1cMYhLefn42A=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=DGyCcose2xFMmWUGxTIG+YWgoTQWfMdZkqK55exYWELysfSRJSrCG1cNg6Cb8yOsu kFsg1QEmdkjAXAwdeNdbq96ENz5WvGYng6AsT9Il72T1ItjYJyVwps8pgMpq1PVReM ZE/YdukSP/g+V4har7VsQdGtYsVsOqSaQsQjnCmI+u+pF+icYasBibglOXBbMtoPkV bq7X7xZDsmwl2KX/RfTemwqdt7dADG6D2m56kAsbvkOpL2U59qoNr63EdNcI1QzcKq iU/b8WujxYe1AyxpA5ZuVoT2YU0UoS4dPw8/cIYuYuVONxlCagyIBWcPTPuTyz736j /HLRRD0SSRHlg== To: "G. P. B." Cc: =?UTF-8?Q?Dino_Pejakovi=c4=87?= , PHP internals , Christoph Michael Becker , Derick Rethans , Sara Golemon , Gabriel Caruso References: <08b959f5-7652-5e8a-562a-c2659facec8c@voxdiversa.hr> <20277058-b463-038a-4333-eacd023ccdc4@beccati.com> Message-ID: <3220cfac-aeca-0e28-3574-77e2b2c89b1d@beccati.com> Date: Fri, 28 Aug 2020 09:18:55 +0200 MIME-Version: 1.0 In-Reply-To: <20277058-b463-038a-4333-eacd023ccdc4@beccati.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PDO fetch performance problems with many bind parameters From: php@beccati.com (Matteo Beccati) Hi George, /cc release managers - pls don't hate me ;-) On 27/08/2020 10:23, Matteo Beccati wrote: > > On 26/08/2020 19:28, G. P. B. wrote: >> This can still target PHP 8.0 as this seems to be akin to a bug this >> might even be applicable to PHP 7.3/7.4. Anyways, good catch. > > You could be right. I've created a draft PR for review: Dino could yo> please benchmark it and get back with results?> > https://github.com/php/php-src/pull/6047 The PR seems to fix the issue: https://bugs.php.net/bug.php?id=80027 Dino's bench script takes 3s on vanilla PHP8 and 120ms with the patch, so it's seems a fairly good win. The fetching part alone goes down from 2.9s to 3ms. The way it's been fixed should be backwards and forwards compatible with no real need to bump PDO_VERSION_API: external PDO driver extensions wanting to use the param_evt_skip flags could simply set them via a preprocessor macro when compiled for PHP8+. For now I've optimised the pdo_pgsql/mysql/sqlite extensions, but I will look into the other bundled ones too. Would you think it's sensible to treat this as a bug fix and target 7.3+? Or is it better to do PHP8 only? Or? Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/