Skip to content

[pull] master from php:master#510

Merged
pull[bot] merged 3 commits intoturkdevops:masterfrom
php:master
Nov 3, 2025
Merged

[pull] master from php:master#510
pull[bot] merged 3 commits intoturkdevops:masterfrom
php:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Nov 3, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Mdsujansarkar and others added 3 commits November 3, 2025 15:30
This avoids duplicating the intermediate strings, by transferring
ownership.

It's hard to measure the improvement in a reliable way, as we have to
operate on the same node. The following benchmark shows a nice
improvement (although not perfect as a benchmark):
```php
<?php

$dom = new DOMDocument;
$dom->loadXML('<root>testabcdef</root>');
$text = $dom->documentElement->firstChild;

for ($i = 0; $i < 1000000; $i++) {
    $text2 = clone $text;
    $text2->splitText(5);
}
```

Only tested on my desktop i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
  Time (mean ± σ):     284.1 ms ±   2.8 ms    [User: 280.0 ms, System: 3.0 ms]
  Range (min … max):   281.4 ms … 291.3 ms    10 runs

Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):     314.0 ms ±   7.8 ms    [User: 309.2 ms, System: 2.9 ms]
  Range (min … max):   306.5 ms … 328.0 ms    10 runs

Summary
  ./sapi/cli/php x.php ran
    1.11 ± 0.03 times faster than ./sapi/cli/php_old x.php
```
This fixes missing constants on MacOS where TCP_KEEPALIVE,
TCP_KEEPINTVL and TCP_KEEPCNT are available. Currently only
TCP_KEEPALIVE is defined there.
@pull pull bot locked and limited conversation to collaborators Nov 3, 2025
@pull pull bot added the ⤵️ pull label Nov 3, 2025
@pull pull bot merged commit 2d105af into turkdevops:master Nov 3, 2025
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants