| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| /** | ||
| * @return array<string,mixed> | ||
| */ | ||
| public function execute(/** include the run ID here **/string $script): array |
There was a problem hiding this comment.
the idea was to include the run ID so that it can be used to namespace the file rather than use a uniqid. Doesn't help if we support parallel benchmarking in the future (not sure if that's a valid use case though)
Sorry, something went wrong.
| $value = $evaluator->evaluateType($node->node(), NumberNode::class, $params); | ||
| $value = $evaluator->evaluate($node->node(), $params); | ||
|
|
||
| if ($value instanceof NullNode) { |
There was a problem hiding this comment.
revert
Sorry, something went wrong.
| { | ||
| public function create(array $data): ResultInterface | ||
| { | ||
| return new TimeResult(($data['net']), $data['revs'], 'nanoseconds'); |
There was a problem hiding this comment.
use TimeUnit constant
Sorry, something went wrong.
There was a problem hiding this comment.
validate for array key existence
Sorry, something went wrong.
| public function getNet(): int | ||
| { | ||
| return $this->netTime; | ||
| return (int)$this->netTime; |
There was a problem hiding this comment.
should be fine to change this to a float? in the medium term we need to change the base from microseconds to nanoseconds. not actually sure what uses this method.
Sorry, something went wrong.
|
|
||
| namespace PhpBench\Executor; | ||
|
|
||
| class PhpProcessOptions |
There was a problem hiding this comment.
final
Sorry, something went wrong.
| $stage = $this->scriptStages[$node->name]; | ||
| $lines = $this->indent(array_merge([ | ||
| sprintf('// >>> %s', $node->name), | ||
| ], $stage->start($context)), $indentation); |
There was a problem hiding this comment.
s/node/unit
Sorry, something went wrong.
| public const T_QUESTION = 'question'; | ||
| public const T_SEMICOLON = 'semicolon'; | ||
| public const T_OPEN_BRACE = 'open_brace'; | ||
| public const T_CLOSE_BRACE = 'close_brace'; |
There was a problem hiding this comment.
can remove these now?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR experiments with adding a new executor which can execute benchmark variants according to "programs".
A program is a nestable sequence of named "code snippets"/units which are used to compose the benchmarking script.
Benefits:
The default PHPBench executor can be reproduced with:
[ 'before_methods', 'warmup', 'hrtime_sampler', [ 'hrtime_sampler', 'call_subject', ], 'after_methods', 'memory_sampler" ]POC TODO:
TODO:
IDEAS: