Draft
Conversation
3fd9de2 to
b385644
Compare
dantleech
commented
Nov 21, 2021
dantleech
commented
Nov 28, 2021
| /** | ||
| * @return array<string,mixed> | ||
| */ | ||
| public function execute(/** include the run ID here **/string $script): array |
Member
Author
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)
dantleech
commented
Nov 28, 2021
| $value = $evaluator->evaluateType($node->node(), NumberNode::class, $params); | ||
| $value = $evaluator->evaluate($node->node(), $params); | ||
|
|
||
| if ($value instanceof NullNode) { |
dantleech
commented
Nov 28, 2021
| { | ||
| public function create(array $data): ResultInterface | ||
| { | ||
| return new TimeResult(($data['net']), $data['revs'], 'nanoseconds'); |
Member
Author
There was a problem hiding this comment.
validate for array key existence
dantleech
commented
Nov 28, 2021
| public function getNet(): int | ||
| { | ||
| return $this->netTime; | ||
| return (int)$this->netTime; |
Member
Author
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.
dantleech
commented
Nov 28, 2021
be35b89 to
f158ab3
Compare
f158ab3 to
ea4d34b
Compare
dantleech
commented
Jan 30, 2022
|
|
||
| namespace PhpBench\Executor; | ||
|
|
||
| class PhpProcessOptions |
dantleech
commented
Jan 30, 2022
| $stage = $this->scriptStages[$node->name]; | ||
| $lines = $this->indent(array_merge([ | ||
| sprintf('// >>> %s', $node->name), | ||
| ], $stage->start($context)), $indentation); |
dantleech
commented
Jan 30, 2022
| public const T_QUESTION = 'question'; | ||
| public const T_SEMICOLON = 'semicolon'; | ||
| public const T_OPEN_BRACE = 'open_brace'; | ||
| public const T_CLOSE_BRACE = 'close_brace'; |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
forloop over the revs, print out the call N times)The default PHPBench executor can be reproduced with:
POC TODO:
TODO:
IDEAS: