Perfomance tuning

Discussion in 'Ruby' started by Emil Sandin, Mar 13, 2007.

  1. Emil Sandin

    Emil Sandin Guest

    Hi,
    I have an application that takes a little to long to execute. I would
    like to know where I could gain most.

    Whenever a metod is called, I would like to store the execution time and
    number of executions. Then, at the end of the applications execution,
    print it out. Something like:

    Object1 =>
    method1 => called 10 times, 30 milliseconds total time
    method2 => called 1 times, 5 milliseconds total time
    Object2 =>
    method1 => called 1 times, 2 milliseconds total time
    method2 => called 30 times, 500 milliseconds total time
    ...

    How would I do this?
    Regards
    Emil

    --
    Posted via http://www.ruby-forum.com/.
     
    Emil Sandin, Mar 13, 2007
    #1
    1. Advertising

  2. A.S. Bradbury, Mar 13, 2007
    #2
    1. Advertising

  3. Emil Sandin

    Alex Young Guest

    Emil Sandin wrote:
    > Hi,
    > I have an application that takes a little to long to execute. I would
    > like to know where I could gain most.
    >
    > Whenever a metod is called, I would like to store the execution time and
    > number of executions. Then, at the end of the applications execution,
    > print it out. Something like:
    >
    > Object1 =>
    > method1 => called 10 times, 30 milliseconds total time
    > method2 => called 1 times, 5 milliseconds total time
    > Object2 =>
    > method1 => called 1 times, 2 milliseconds total time
    > method2 => called 30 times, 500 milliseconds total time
    > ...
    >
    > How would I do this?


    Investigate 'profile' in the standard library
    (http://www.rubycentral.com/book/trouble.html) or ruby-prof
    (http://ruby-prof.rubyforge.org/). Both do what you want, but the
    latter is more comprehensive.

    --
    Alex
     
    Alex Young, Mar 13, 2007
    #3
  4. Emil Sandin

    Emil Sandin Guest

    Emil Sandin, Mar 13, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gnanaprakash Rathinam

    CreateInstranceAndUnwrap slow perfomance

    Gnanaprakash Rathinam, Dec 29, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,140
    David Levine
    Dec 30, 2004
  2. Fredrik Melin

    Server perfomance

    Fredrik Melin, Oct 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    417
    Paul Glavich [MVP - ASP.NET]
    Oct 27, 2004
  3. Scott Reynolds

    data perfomance?

    Scott Reynolds, Mar 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    429
    Karl Seguin
    Mar 1, 2005
  4. George

    Huge HTML output perfomance

    George, Mar 28, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    680
    Robbe Morris [C# MVP]
    Mar 29, 2005
  5. James T.

    Perfomance test

    James T., Feb 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    412
    James T.
    Feb 26, 2006
Loading...

Share This Page