Ruby on Rails Friday, February 25, 2011

Thanks, nice idea for installing ruby-prof.  Never used it before and it's extremely easy to install and use.
I'm on Windows so I needed to install with this command:

gem install ruby-prof --platform=mswin32 -v 0.8.1

I tried it on a simpler query and I give the top lines of the profile here.
You can see that it takes 5.9 seconds with virtually all the time spend in
Mysql2::Client#query. When I run the same query through
the console it takes 812ms.

Thread ID: 25569168
Total: 5.910000

%self total self wait child calls name
99.14 5.86 5.86 0.00 0.00 1 Mysql2::Client#query (ruby_runtime:0}
0.42 0.03 0.03 0.00 0.00 2 Kernel#require (ruby_runtime:0}
0.32 0.04 0.02 0.00 0.03 1 ActiveRecord::ConnectionAdapters::Quoting#quote (C:/ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/quoting.rb:8}
0.03 0.00 0.00 0.00 0.00 147 <Class::ActiveRecord::Base>#instantiate (C:/ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/base.rb:907}
0.02 0.00 0.00 0.00 0.00 28 Kernel#hash (ruby_runtime:0}
0.02 0.00 0.00 0.00 0.00 5 Kernel#clone (ruby_runtime:0}
0.02 0.00 0.00 0.00 0.00 147 ActiveRecord::Base#_run_initialize_callbacks (C:/ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:401}
...

I'm still stuck to know why it takes so much longer :(

William

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment