Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5ab5b7
commit 9ed4c9e
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhelTest\Benchmark\Phel; | ||
|
||
use Phel\Build\BuildFacade; | ||
use Phel\Compiler\Analyzer\Environment\GlobalEnvironmentSingleton; | ||
use Phel\Lang\Symbol; | ||
use Phel\Phel; | ||
|
||
/** | ||
* @BeforeMethods("setUp") | ||
* @Revs(5) | ||
* @Iterations(2) | ||
*/ | ||
final class PhelBench | ||
{ | ||
public function setUp(): void | ||
{ | ||
Symbol::resetGen(); | ||
GlobalEnvironmentSingleton::initializeNew(); | ||
|
||
(new BuildFacade())->compileFile( | ||
__DIR__ . '/../../../../src/phel/core.phel', | ||
tempnam(sys_get_temp_dir(), 'phel-core') | ||
); | ||
} | ||
|
||
public function bench_phel_run(): void | ||
{ | ||
Phel::run(__DIR__ . '/../../../../', 'phel\\core'); | ||
} | ||
} |