[php-src] PR #15626: Optimize DOM property access
| From: | nielsdos | Date: | Wed, 28 Aug 2024 21:42:01 +0000 |
| Subject: | [php-src] PR #15626: Optimize DOM property access | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28255@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15626
Author: nielsdos
For the read and write implementation, store the handler pointer in the first cache slot.
For the write implementation, use the second cache slot to store the property info.
For a micro-benchmark that performs a write:
```php
$dom = new DOMDocument;
for ($i=0;$i<9999999;$i++)
$dom->strictErrorChecking = false;
```
I obtain the following results on an i7-4790:
```
./sapi/cli/php ./write.php ran
1.42 ± 0.08 times faster than ./sapi/cli/php_old ./write.php
```
For a micro-benchmark that performs a read:
```php
$dom = new DOMDocument;
for ($i=0;$i<9999999;$i++)
$dom->strictErrorChecking;
```
I obtain the following results on the same machine:
```
./sapi/cli/php ./read.php ran
1.29 ± 0.13 times faster than ./sapi/cli/php_old ./read.php
```