How can get my object's memory usage size and method load time?

235 views
Skip to first unread message

Ponnusamy K

unread,
Sep 7, 2013, 6:13:23 AM9/7/13
to ruby-opt...@googlegroups.com
Hi!

this is my ruby prof report

flat.txt

 %self      total      self      wait     child     calls  name
 16.04      0.481     0.479     0.000     0.002      117   Mysql2::Client#query 
  8.06      0.244     0.241     0.000     0.003      328   Module#remove_method 
  7.83      0.659     0.234     0.000     0.426       18  *<Module::Kernel>#load 
  7.23      0.216     0.216     0.000     0.000      792   IO#getbyte 
  5.29      0.160     0.158     0.000     0.002     1665   Module#module_eval 
  4.45      0.133     0.133     0.000     0.000       43   <Class::IO>#binread 
  3.67      0.110     0.110     0.000     0.000      190   Kernel#caller 
  3.54      0.106     0.106     0.000     0.000       50  *ActiveRecord::Associations::JoinDependency::JoinPart#reflections 
  2.55      0.076     0.076     0.000     0.000     2622   <Class::File>#join 
  2.50      0.079     0.075     0.000     0.004      165   NewRelic::Agent::TransactionSampleBuilder#trace_entry 
  2.40      0.072     0.072     0.000     0.000      170   NewRelic::Agent::StatsEngine::ScopeStackElement#initialize 
  1.28      0.296     0.038     0.000     0.258      646  *Module#class_eval 

graph.txt

                      0.005      0.000      0.000      0.005             2/20      ActiveRecord::Associations::ClassMethods#has_many
                      0.002      0.000      0.000      0.002           60/123      Object#presence
                      0.001      0.000      0.000      0.001             2/26      ActiveRecord::Associations::ClassMethods#belongs_to
                      0.001      0.000      0.000      0.001             2/29      ActionView::Helpers::UrlHelper#link_to
                      0.001      0.000      0.000      0.001              1/1      <Class::UserExercise(id: integer, user_id: integer, exam_day_exercise_id: integer, exam_day_id: integer, status: string, created_at: datetime, updated_at: datetime)>#today_exercises
                      0.001      0.000      0.000      0.001              1/1      <Class::Award(id: integer, name: string, description: text, image: string, status: string)>#get_all_awards
                      0.001      0.000      0.000      0.001              2/2      ActionView::Helpers::TextHelper#pluralize
                      0.001      0.000      0.000      0.001             2/13      ActiveRecord::Querying#joins
                      0.001      0.000      0.000      0.001              1/1      <Class::Student(id: integer, user_id: integer, current_exam_id: integer, medium: integer, phone: integer, address: text, district: string, school_name: string, created_at: datetime, updated_at: datetime, city: string, pincode: integer, referred_by: string, plan_click: integer, reg_no: integer, state_id: integer, avatar: string, point: integer)>#standings_for
                      0.000      0.000      0.000      0.000              1/3      #<Module:0x000000074f27c8>#dashboard
                      0.000      0.000      0.000      0.000              1/1      <Class::FollowStudent(id: integer, student_id: integer, following_student_id: integer, created_at: datetime, updated_at: datetime, status: string)>#followers
                      0.000      0.000      0.000      0.000           60/154      String#scan

What can i get from this report, and how do i optimize my application?

Roger Pack

unread,
Sep 9, 2013, 2:34:59 PM9/9/13
to ruby optimization
What do you mean by an object's "memory size usage"?  Are you looking for memory profiling, to see which methods use more?  By method load time do you mean how long it took to run a method?  What "mode" are you using for your output here?


--
 
---
You received this message because you are subscribed to the Google Groups "ruby optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-optimizat...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages