Page MenuHomePhabricator
Paste P1892

xhpast_tree.php
ActivePublic

Authored by joshuaspence on Nov 17 2015, 8:29 PM.
Tags
Referenced Files
F974629: xhpast_tree.php
Feb 24 2016, 1:31 AM
Subscribers
None
<?php
require_once __DIR__.'/scripts/__init_script__.php';
$console = PhutilConsole::getConsole();
$iterations = 10;
$source = Filesystem::readFile(__DIR__.'/../phabricator/src/__phutil_library_map__.php');
$start = microtime(true);
for ($ii = 0; $ii < $iterations; $ii++) {
XHPASTTree::newFromData($source);
}
$end = microtime(true);
$duration = $end - $start;
$console->writeOut("Average: %fs\n", $duration / $iterations);
$console->writeOut("Total: %fs\n", $duration);