-
Notifications
You must be signed in to change notification settings - Fork 142
Benchmark runner #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Benchmark runner #137
Conversation
This reverts commit 9a85ced.
|
@martinsik This looks awesome! I ran it against v2 and I'm getting some unexpected results. I would think that the performance would be about the same, but v1 is way faster for some of the operators! v1: v2: |
benchmark/run.php
Outdated
| define('MIN_TOTAL_DURATION', 5); | ||
| $start = microtime(true); | ||
|
|
||
| if ($_SERVER['argc'] == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should that be a ===?
benchmark/run.php
Outdated
| } else { | ||
| // Force absolute path | ||
| $files = array_map(function($file) { | ||
| return $file[0] == DIRECTORY_SEPARATOR ? $file : $_SERVER['PWD'] . DIRECTORY_SEPARATOR . $file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should that be a ===?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right with both.
|
Figured it out. It's because we changed the default scheduler in v2 to the EventLoopScheduler. When I set them to Immediate, I get results closer to what I was expecting: I take it that the plan is to eventually add benchmarks for the different schedulers. |
|
With the latest changes: v1: v2: |
|
It didn't occur to me at first but I think we'll have to write scripts for both I updated |
1 similar comment
|
This was closed by github when I moved master to 2.x - I have reopened it against the 1.5 branch |
|
Changes Unknown when pulling 0c792a7 on martinsik:benchmark-runner into ** on ReactiveX:1.5**. |
1 similar comment
|
Changes Unknown when pulling 0c792a7 on martinsik:benchmark-runner into ** on ReactiveX:1.5**. |
|
Changes Unknown when pulling 0c792a7 on martinsik:benchmark-runner into ** on ReactiveX:1.x**. |
1 similar comment
|
Changes Unknown when pulling 0c792a7 on martinsik:benchmark-runner into ** on ReactiveX:1.x**. |
|
Changes Unknown when pulling 21489a7 on martinsik:benchmark-runner into ** on ReactiveX:1.x**. |
|
I updated the benchmark runner script so when using a custom loop it doesn't staring the loop over and over again. The results should be more accurate now: Before: After: |
benchmark/run.php
Outdated
| if (!$testClosure) { | ||
| throw new Exception("Unable to load file \"$file\""); | ||
| if (is_array($testDef)) { | ||
| $sourceFactory = $testDef[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You can use use list($sourceFactory, $loop) = $testDef here
|
Changes Unknown when pulling a9a372b on martinsik:benchmark-runner into ** on ReactiveX:1.x**. |
|
Changes Unknown when pulling 6a72f45 on martinsik:benchmark-runner into ** on ReactiveX:1.x**. |
I've mentioned it in #134 already. This is a script runner with a couple of benchmarks that follow their RxJS 5 equivalents.
It can run all tests in the
/benchmark/**/*.phpdirectory with:Or a single script: