Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php/php-src
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3b1918b
Choose a base ref
...
head repository: php/php-src
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 18a385f
Choose a head ref
  • 13 commits
  • 11 files changed
  • 2 contributors

Commits on Jun 10, 2025

  1. Fix GH-18820: Windows compilation issue: php-src\Zend\zend_exceptions…

    ….h(75): error C2122: 'message': prototype parameter in name list illegal
    
    INTERNAL_FUNCTION_PARAMETERS is defined in zend.h, but not included in
    zend_exceptions.h (and it shouldn't). Expand the macro to fix the
    compile issue.
    nielsdos committed Jun 10, 2025
    Configuration menu
    Copy the full SHA
    0a95b2f View commit details
    Browse the repository at this point in the history
  2. Improve performance of unpack() with nameless repetitions (#18803)

    We can avoid creating temporary strings, and then reparsing them into
    numbers with zend_symtable_update() by using zend_hash_index_update()
    directly.
    
    For the following benchmark on an i7-4790:
    ```php
    $file = str_repeat('A', 100000);
    for ($i=0;$i<100;$i++) unpack('C*',$file);
    ```
    
    I get:
    ```
    Benchmark 1: ./sapi/cli/php y.php
      Time (mean ± σ):      85.8 ms ±   1.8 ms    [User: 74.5 ms, System: 10.4 ms]
      Range (min … max):    83.8 ms …  92.4 ms    33 runs
    
    Benchmark 2: ./sapi/cli/php_old y.php
      Time (mean ± σ):     318.3 ms ±   2.7 ms    [User: 306.7 ms, System: 9.9 ms]
      Range (min … max):   314.9 ms … 321.6 ms    10 runs
    
    Summary
      ./sapi/cli/php y.php ran
        3.71 ± 0.08 times faster than ./sapi/cli/php_old y.php
    ```
    
    On an i7-1185G7 I get:
    ```
    Benchmark 1: ./sapi/cli/php test.php
      Time (mean ± σ):      60.1 ms ±   0.7 ms    [User: 47.8 ms, System: 12.0 ms]
      Range (min … max):    59.2 ms …  63.8 ms    48 runs
    
      Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
    
    Benchmark 2: ./sapi/cli/php_old test.php
      Time (mean ± σ):     220.8 ms ±   2.2 ms    [User: 209.6 ms, System: 10.7 ms]
      Range (min … max):   218.5 ms … 224.5 ms    13 runs
    
    Summary
      ./sapi/cli/php test.php  ran
        3.67 ± 0.06 times faster than ./sapi/cli/php_old test.php
    ```
    nielsdos authored Jun 10, 2025
    Configuration menu
    Copy the full SHA
    559858c View commit details
    Browse the repository at this point in the history
  3. Remove dead code from openssl_spki_new() implementation (#18752)

    If s is not NULL, the length can't be <= 0 because we at least append
    `spkac` in the string, which is non-empty.
    I noticed this condition because if it were actually possible to
    execute, then it would leak memory.
    nielsdos authored Jun 10, 2025
    Configuration menu
    Copy the full SHA
    dbabbe1 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2025

  1. ext/standard/pack: Inline constant single use variables

    They serve no purpose and are just confusing
    Girgias committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    2a77e28 View commit details
    Browse the repository at this point in the history
  2. ext/standard/pack: Remove useless casts

    And use char instead of widening to int for no reason
    Girgias committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    e96a7f0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34e22c5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a297a44 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    def3a95 View commit details
    Browse the repository at this point in the history
  6. Simplify callers of zval_try_get_long() (#18830)

    Since 2b38384 references are handled properly by the Zend API, so we
    can simplify the callers by removing reference handling from there.
    nielsdos authored Jun 12, 2025
    Configuration menu
    Copy the full SHA
    029a788 View commit details
    Browse the repository at this point in the history
  7. Use zend_string_release_ex() in concat_function() (#18827)

    The strings we encounter are either interned in which case the
    persistent bool doesn't matter; or they're temporary as the code already
    assumes that anyway.
    This patch shrinks the function from 3332 bytes to 3173 bytes on x86-64
    with GCC 15.1.1.
    nielsdos authored Jun 12, 2025
    Configuration menu
    Copy the full SHA
    28a083b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    42b9b2f View commit details
    Browse the repository at this point in the history
  9. Optimize pack()

    Instead of using lookup tables, we can use a combination of shifts and
    byte swapping to achieve the same thing in less cycles and with less
    code.
    
    Benchmark files
    ---------------
    
    pack1.php:
    ```php
    for ($i = 0; $i < 10_000_000; ++$i) {
        pack("J", 0x7FFFFFFFFFFFFFFF);
    }
    ```
    
    pack2.php:
    ```php
    for ($i = 0; $i < 4000000; ++$i) {
        pack("nvc*", 0x1234, 0x5678, 65, 66);
    }
    ```
    
    On an i7-4790:
    ```
    Benchmark 1: ./sapi/cli/php pack1.php
      Time (mean ± σ):     408.8 ms ±   3.4 ms    [User: 406.1 ms, System: 1.6 ms]
      Range (min … max):   403.6 ms … 413.6 ms    10 runs
    
    Benchmark 2: ./sapi/cli/php_old pack1.php
      Time (mean ± σ):     451.7 ms ±   7.7 ms    [User: 448.5 ms, System: 2.0 ms]
      Range (min … max):   442.8 ms … 461.2 ms    10 runs
    
    Summary
      ./sapi/cli/php pack1.php ran
        1.11 ± 0.02 times faster than ./sapi/cli/php_old pack1.php
    
    Benchmark 1: ./sapi/cli/php pack2.php
      Time (mean ± σ):     239.3 ms ±   6.0 ms    [User: 236.2 ms, System: 2.3 ms]
      Range (min … max):   233.2 ms … 256.8 ms    12 runs
    
    Benchmark 2: ./sapi/cli/php_old pack2.php
      Time (mean ± σ):     271.9 ms ±   3.3 ms    [User: 269.7 ms, System: 1.3 ms]
      Range (min … max):   267.4 ms … 279.0 ms    11 runs
    
    Summary
      ./sapi/cli/php pack2.php ran
        1.14 ± 0.03 times faster than ./sapi/cli/php_old pack2.php
    ```
    
    On an i7-1185G7:
    ```
    Benchmark 1: ./sapi/cli/php pack1.php
      Time (mean ± σ):     263.7 ms ±   1.8 ms    [User: 262.6 ms, System: 0.9 ms]
      Range (min … max):   261.5 ms … 268.2 ms    11 runs
    
    Benchmark 2: ./sapi/cli/php_old pack1.php
      Time (mean ± σ):     303.3 ms ±   6.5 ms    [User: 300.7 ms, System: 2.3 ms]
      Range (min … max):   297.4 ms … 318.1 ms    10 runs
    
    Summary
      ./sapi/cli/php pack1.php ran
        1.15 ± 0.03 times faster than ./sapi/cli/php_old pack1.php
    
    Benchmark 1: ./sapi/cli/php pack2.php
      Time (mean ± σ):     156.7 ms ±   2.9 ms    [User: 154.7 ms, System: 1.7 ms]
      Range (min … max):   151.6 ms … 164.7 ms    19 runs
    
    Benchmark 2: ./sapi/cli/php_old pack2.php
      Time (mean ± σ):     174.6 ms ±   3.3 ms    [User: 171.9 ms, System: 2.3 ms]
      Range (min … max):   170.7 ms … 180.4 ms    17 runs
    
    Summary
      ./sapi/cli/php pack2.php ran
        1.11 ± 0.03 times faster than ./sapi/cli/php_old pack2.php
    ```
    
    Co-authored-by: divinity76@gmail.com
    nielsdos committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    836cda6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    18a385f View commit details
    Browse the repository at this point in the history
Loading