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

EM::Completion performance vs EM::Deferrable #231

Open
AE9RB opened this issue Jul 31, 2011 · 2 comments
Open

EM::Completion performance vs EM::Deferrable #231

AE9RB opened this issue Jul 31, 2011 · 2 comments

Comments

@AE9RB
Copy link
Contributor

AE9RB commented Jul 31, 2011

I saw EM::Completion arrive as a new feature and tested it out. On the following benchmark I perform 75000 queries to a database server. Yes, more than 50k/sec, not a typo! EM::Deferrable appears twice as fast.

                user     system      total        real
Deferrable  1.390000   0.080000   1.470000 (  1.465720)
Completion  3.170000   0.120000   3.290000 (  3.372402)

The following commit supports EM::Completion. It is not supported in any other commit.
https://github.com/dturnbull/ruby-redis/tree/8d6485c161993
You can run test/bench.rb to reproduce.

@raggi
Copy link
Member

raggi commented Aug 1, 2011

The price you pay for thread safety.

Although this is likely use case bound, there may be some available options for optimization.

On Jul 31, 2011, at 3:10 PM, dturnbull wrote:

I saw EM::Completion arrive as a new feature and tested it out. On the following benchmark I perform 75000 queries to a database server. Yes, more than 50k/sec, not a typo! EM::Deferrable appears twice as fast.

               user     system      total        real
Deferrable  1.390000   0.080000   1.470000 (  1.465720)
Completion  3.170000   0.120000   3.290000 (  3.372402)

The following commit supports EM::Completion. It is not supported in any other commit.
https://github.com/dturnbull/ruby-redis/tree/8d6485c161993
You can run test/bench.rb to reproduce.

Reply to this email directly or view it on GitHub:
#231

@AE9RB
Copy link
Contributor Author

AE9RB commented Aug 1, 2011

I looked deeper into this. I think half is from EM.schedule and the other half from extra work succeeding a request. It's probably not a big deal for most, but I was wondering what your plans for Deferrable are now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants