Skip to content
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

Add benchmarking example #162

Merged
merged 1 commit into from
Apr 7, 2017
Merged

Add benchmarking example #162

merged 1 commit into from
Apr 7, 2017

Conversation

clue
Copy link
Member

@clue clue commented Apr 6, 2017

It is fast. :shipit:

@clue clue added this to the v0.7.0 milestone Apr 6, 2017
@clue
Copy link
Member Author

clue commented Apr 6, 2017

My rather mediocre laptop (Intel i3-5005U CPU @ 2.00GHz) can process around ~2000 requests/s or around 2000 MiB/s per core.

@WyriHaximus WyriHaximus requested review from jsor and WyriHaximus April 6, 2017 20:13
Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managed to get 6.4K request/sec and 2GiB/s out of it on a Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz and 8.5K request/sec and 2.6GiB/s on a Intel(R) Xeon(R) CPU E5-1630 v3 @ 3.70GHz 👍

return new Response(404);
}

$loop->addTimer(0, array($stream, 'resume'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a future tick instead here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both would work here 👍 Using a timer here also makes this compatible with react/event-loop:^0.3 though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point 👍

@clue
Copy link
Member Author

clue commented Apr 6, 2017

For the reference: The failing tests are unrelated and are being addressed in #163.

@clue
Copy link
Member Author

clue commented Apr 7, 2017

Rebased now that #163 is in :shipit:

@clue clue merged commit d9eba1b into reactphp:master Apr 7, 2017
@clue clue deleted the benchmark branch April 7, 2017 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants