Ruler icon indicating copy to clipboard operation
Ruler copied to clipboard

Example benchmark

Open dantleech opened this issue 9 years ago • 4 comments

Just an example benchmark using PHPBench to get things started.

$ phpbench report --uuid=latest --report=hoa
benchmark: RulerBench, subject: benchAssert
+---------------------------------------------------------------+------+-----+------------+---------+---------+---------+--------+
| params                                                        | revs | its | mem_peak   | best    | mean    | mode    | rstdev |
+---------------------------------------------------------------+------+-----+------------+---------+---------+---------+--------+
| {"rule":"group in [\"customer\", \"guest\"] and points > 30"} | 10   | 10  | 2,249,760b | 3.786ms | 4.724ms | 4.123ms | 15.20% |
| {"rule":"points > 30"}                                        | 10   | 10  | 2,200,408b | 1.386ms | 1.836ms | 1.909ms | 17.00% |
| {"rule":"group in [\"customer\", \"guest\"]"}                 | 10   | 10  | 2,216,400b | 2.240ms | 2.781ms | 2.715ms | 15.34% |
+---------------------------------------------------------------+------+-----+------------+---------+---------+---------+--------+``

dantleech avatar Sep 24 '16 09:09 dantleech

Not currently, sounds like something that could easily be configured though (i.e. assert_ instead of bench)

On Mon, Sep 26, 2016 at 05:20:18AM -0700, Ivan Enderlin wrote:

@Hywan commented on this pull request.


In [1]Test/Benchmark/RulerBench.php:

  •        ],
    
    •        [
      
    •            'rule' => 'points > 30'
      
    •        ],
      
    •    ];
      
    • } +
    • /**
    • \* Benchmark parsing with rules of different complexity.
      
    • \* Executes the method once (warmup) before measuring time.
      
    • *
      
    • \* @Warmup(1)
      
    • \* @BeforeMethods({"setUpAssert"})
      
    • \* @ParamProviders({"provideRules"})
      
    • */
      
    • public function benchAssert($params)

So there is no way to say: “All methods matching this pattern are of kind bench”?

— You are receiving this because you authored the thread. Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.

Reverse link: [4]unknown

References

Visible links

  1. https://github.com/hoaproject/Ruler/pull/96
  2. https://github.com/hoaproject/Ruler/pull/96
  3. https://github.com/notifications/unsubscribe-auth/AAgZcQIOyBIeqWioLjZfmtK-jRt2hSjuks5qt7iCgaJpZM4KFmfz
  4. https://github.com/hoaproject/Ruler/pull/96

dantleech avatar Sep 26 '16 13:09 dantleech

It could be a good idea and a good feature!

Hywan avatar Sep 26 '16 13:09 Hywan

@dantleech Am I a despot if I ask you to update this PR based on PHPBench 0.12.2?

Hywan avatar Oct 14 '16 07:10 Hywan

@Hywan no problem, updated :)

dantleech avatar Oct 14 '16 08:10 dantleech