Issue #6019 has been updated by Yura Sokolov.


Rails already include fix against this issue into its trunk: https://github.com/rails/rails/pull/5039

Any way, could second parameter have more variants? So that:
- `respond_to?(:meth)` and `respond_to?(:meth, nil)` will test for public methods,
- `respond_to?(:meth, true)` will test all methods
- `respond_to?(:meth, false)` (or `respond_to?(:meth, :with_protected)`) will test for public and protected methods

It is just a suggestion and I could not prove it will be very useful.
----------------------------------------
Bug #6019: Revision r34582  significantly slows down rails app
https://bugs.ruby-lang.org/issues/6019

Author: Yura Sokolov
Status: Assigned
Priority: Normal
Assignee: Akinori MUSHA
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-02-14 trunk 34592) [i686-linux]


Before r34582 simple rails32 app (query sqlite and disply 20 rows of simple data)
benchmarked as 55req/second , after its performance is 33req/second.

I could agree that RubyOnRails should be in sync with ruby, but maybe there is other way
to fix `respond_to?` ?


-- 
http://bugs.ruby-lang.org/