| benchmark | subject | group | params | revs | its | mem | best | mean | mode | worst | stdev | rstdev | diff |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ForBench | benchOuterAssignmentCriteria | {"number":"100"} | 100 | 10 | 283,240b | 0.013ms | 0.014ms | 0.014ms | 0.014ms | 0.277μs | 2.02% | +3.15% | |
| ForBench | benchOuterAssignmentCriteria | {"number":"1000"} | 100 | 10 | 369,624b | 0.116ms | 0.119ms | 0.121ms | 0.122ms | 2.352μs | 1.97% | +797.40% | |
| ForBench | benchOuterAssignmentCriteria | {"number":"10000"} | 100 | 10 | 1,284,504b | 1.139ms | 1.169ms | 1.161ms | 1.205ms | 19.049μs | 1.63% | +8,687.27% | |
| ForBench | benchInlineAssignmentCriteria | {"number":"100"} | 100 | 10 | 283,192b | 0.062ms | 0.064ms | 0.065ms | 0.066ms | 1.417μs | 2.21% | +381.14% | |
| ForBench | benchInlineAssignmentCriteria | {"number":"1000"} | 100 | 10 | 369,576b | 0.586ms | 0.607ms | 0.600ms | 0.628ms | 15.086μs | 2.49% | +4,462.30% | |
| ForBench | benchInlineAssignmentCriteria | {"number":"10000"} | 100 | 10 | 1,284,456b | 5.603ms | 5.735ms | 5.683ms | 5.881ms | 88.786μs | 1.55% | +43,022.01% | |
| ForBench | benchInlineAssignmentStarting | {"number":"100"} | 100 | 10 | 283,192b | 0.013ms | 0.013ms | 0.013ms | 0.014ms | 0.321μs | 2.41% | 0.00% | |
| ForBench | benchInlineAssignmentStarting | {"number":"1000"} | 100 | 10 | 369,576b | 0.120ms | 0.122ms | 0.121ms | 0.125ms | 1.648μs | 1.36% | +814.60% | |
| ForBench | benchInlineAssignmentStarting | {"number":"10000"} | 100 | 10 | 1,284,456b | 1.298ms | 1.336ms | 1.334ms | 1.400ms | 26.941μs | 2.02% | +9,945.27% |
Last active
January 25, 2016 17:30
-
-
Save dantleech/15a418b79187aaeb72a0 to your computer and use it in GitHub Desktop.
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
| <?php | |
| /** | |
| * @Iterations(10) | |
| * @Revs(100) | |
| * @BeforeMethods({"setUp"}) | |
| * @ParamProviders({"provideNumber"}) | |
| */ | |
| class ForBench | |
| { | |
| private $values; | |
| public function setUp($params) | |
| { | |
| $this->values = array_fill(0, $params['number'], 'Hello'); | |
| } | |
| public function benchOuterAssignmentCriteria() | |
| { | |
| $count = count($this->values); | |
| for ($i = 0; $i <= $count; $i++) { | |
| } | |
| } | |
| public function benchInlineAssignmentCriteria() | |
| { | |
| for ($i = 0; $i <= count($this->values); $i++) { | |
| } | |
| } | |
| public function benchInlineAssignmentStarting() | |
| { | |
| for ($i = count($this->values); $i >= 0; $i--) { | |
| } | |
| } | |
| public function provideNumber() | |
| { | |
| return array( | |
| array( | |
| 'number' => 100, | |
| ), | |
| array( | |
| 'number' => 1000, | |
| ), | |
| array( | |
| 'number' => 10000, | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment