예제 #1
0
파일: run.php 프로젝트: jeremyadoux/hhvm
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Ported to PHP from Google's Octane v2.0 benchmarking suite for JavaScript.
include 'base.php';
include 'huffman.php';
include 'richards.php';
include 'deltablue.php';
include 'splay.php';
include 'quick-hull.php';
$success = true;
$PrintResult = function ($name, $result) {
    print "{$name}: {$result}\n";
};
$PrintError = function ($name, $error) {
    global $success, $PrintResult;
    $PrintResult($name, $error);
    $success = false;
};
$PrintScore = function ($score) {
    global $success;
    if ($success) {
        print "----\n";
        print 'Score (version ' . BenchmarkSuite::$version . "): {$score}\n";
    }
};
BenchmarkSuite::$config['doWarmup'] = null;
BenchmarkSuite::$config['doDeterministic'] = null;
BenchmarkSuite::RunSuites(array('NotifyResult' => $PrintResult, 'NotifyError' => $PrintError, 'NotifyScore' => $PrintScore));