Re: PDO fetch performance problems with many bind parameters
| From: | Matteo Beccati | Date: | Fri, 28 Aug 2020 07:18:55 +0000 |
| Subject: | Re: PDO fetch performance problems with many bind parameters | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111701@lists.php.net to get a copy of this message | ||
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/