treffynnon/Benchmark-PHP-HHVM-Zephir

[JPHP] Add test

Closed this issue · 4 comments

sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle

Looking for a pull request on this one as I don't have any more time for writing this benchmarking suite. @dim-s any interest?

Hi, I have no time for this, but I can give some tips for testing JPHP:

  • Execution in the global and local scopes:
// global scope
for($i = 0; $i < 100500; $i++){
    /// ...
}

// local scope - ~2x faster than in the global scope
funtion test(){
    for($i = 0; $i < 100500; $i++){
       // ...
    }
}
test();
  • In JPHP some functions are not yet implemented
  • JPHP has a smart optimizer that can give false results, for example:
for ($i = 0; $i < 100500; $i++){
    // it will be calculated only one time at compile-time
    $x = cos(1) + 3 / 4 . ("foobar" . __FILE__); 
}

Closing as won't fix