Bug #8335

Performance regression with many threads

Added by Mike Perham about 2 years ago. Updated about 2 years ago.

[ruby-core:54603]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

I've created a simple case to reproduce a performance problem with Sidekiq. A customer is using 200 worker threads to process background jobs and finding it to be quite slow. To process 50,000 jobs, it takes Ruby 1.9.3 about 200 seconds. With Ruby 2.0, the time required is almost double. Please see instructions to reproduce the problem here:

https://github.com/mperham/sidekiq/tree/master/myapp#ruby-20-slowness-with-big-concurrency

History

#1 Updated by Mike Perham about 2 years ago

I have some concern about #8211 so here's the info. Each VM was installed via rbenv.

ruby -v
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.3.0]
ruby -e 'puts RUBY_DESCRIPTION, RbConfig::CONFIG["cflags"], RbConfig::CONFIG["CFLAGS"]'
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.3.0]
-O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration
-g -O2 -Wno-error=shorten-64-to-32 -pipe

rbenv shell 2.0.0-p0
ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
ruby -e 'puts RUBY_DESCRIPTION, RbConfig::CONFIG["cflags"], RbConfig::CONFIG["CFLAGS"]'
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
-O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration
-Wno-error=shorten-64-to-32 -pipe

#2 Updated by Mike Perham about 2 years ago

Confirmed. I rebuilt 2.0.0 with RUBY_CFLAGS="-O3" and now performance is as good or better than 1.9.3. You may close this issue.

#3 Updated by Tomoyuki Chikanaga about 2 years ago

  • Status changed from Open to Closed

Thank you for confirmation.

Also available in: Atom PDF