Skip to content

Conversation

@ndossche
Copy link
Member

@ndossche ndossche commented Nov 6, 2025

This is a proof-of-concept.

Demo speedup on i7-4790:

<?php

$x = range(20, 0);
for ($i = 0; $i < 500000; $i++)
    sort($x);
var_dump($x);
Benchmark 1: ./sapi/cli/php x.php 
  Time (mean ± σ):     123.2 ms ±   3.0 ms    [User: 119.5 ms, System: 2.6 ms]
  Range (min … max):   119.2 ms … 134.1 ms    24 runs
 
Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):     176.8 ms ±   2.5 ms    [User: 173.9 ms, System: 2.1 ms]
  Range (min … max):   174.3 ms … 183.2 ms    17 runs
 
Summary
  ./sapi/cli/php x.php  ran
    1.44 ± 0.04 times faster than ./sapi/cli/php_old x.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant