How to measure speed improvements across revisions over time?

Discussion in 'Python' started by Matthew Wilson, May 10, 2010.

  1. I know how to use timeit and/or profile to measure the current run-time
    cost of some code.

    I want to record the time used by some original implementation, then
    after I rewrite it, I want to find out if I made stuff faster or slower,
    and by how much.

    Other than me writing down numbers on a piece of paper on my desk, does
    some tool that does this already exist?

    If it doesn't exist, how should I build it?

    Matt
     
    Matthew Wilson, May 10, 2010
    #1
    1. Advertising

  2. On Mon, 10 May 2010 20:13:44 +0000, Matthew Wilson wrote:

    > I know how to use timeit and/or profile to measure the current run-time
    > cost of some code.
    >
    > I want to record the time used by some original implementation, then
    > after I rewrite it, I want to find out if I made stuff faster or slower,
    > and by how much.
    >
    > Other than me writing down numbers on a piece of paper on my desk, does
    > some tool that does this already exist?
    >
    > If it doesn't exist, how should I build it?



    from timeit import Timer
    before = Timer(before_code, setup)
    after = Timer(after_code, setup)
    improvement = min(before.repeat()) - min(after.repeat())


    --
    Steven
     
    Steven D'Aprano, May 11, 2010
    #2
    1. Advertising

  3. Matthew Wilson wrote:
    > I know how to use timeit and/or profile to measure the current run-time
    > cost of some code.
    >
    > I want to record the time used by some original implementation, then
    > after I rewrite it, I want to find out if I made stuff faster or slower,
    > and by how much.
    >
    > Other than me writing down numbers on a piece of paper on my desk, does
    > some tool that does this already exist?


    I recommend to use rrd. This can record time series, and then generate
    diagrams.

    Regards,
    Martin
     
    Martin v. Loewis, May 11, 2010
    #3
    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. Just an Illusion

    VHDL revisions comparison

    Just an Illusion, Jun 30, 2004, in forum: VHDL
    Replies:
    1
    Views:
    577
    Arie Zychlinski
    Jun 30, 2004
  2. Phrogz
    Replies:
    8
    Views:
    217
    Simon Kröger
    Sep 2, 2006
  3. Fábio Santos
    Replies:
    0
    Views:
    87
    Fábio Santos
    Apr 24, 2013
  4. Chris “Kwpolska†Warrick

    Re: improvements sought re. logging across modules

    Chris “Kwpolska†Warrick, Apr 24, 2013, in forum: Python
    Replies:
    0
    Views:
    87
    Chris “Kwpolska†Warrick
    Apr 24, 2013
  5. Dave Angel
    Replies:
    0
    Views:
    101
    Dave Angel
    Apr 24, 2013
Loading...

Share This Page