Thank you developers for 2.3

Discussion in 'Python' started by David Lees, Jul 30, 2003.

  1. David Lees

    David Lees Guest

    Flawless install and it ran my very simple minded (try not to laugh)
    nested loop integer arithmetic benchmark twice as fast as 2.2.3
    version 2.3 5.04 sec
    version 2.2.3 9.77 sec

    import time

    def speedTest(N):
    t1 = time.time()
    k = 0
    for i in xrange(N):
    for j in xrange(N):
    k += (i+j)

    t2 = time.time()
    return t2-t1

    print speedTest(3000)

    david lees
     
    David Lees, Jul 30, 2003
    #1
    1. Advertising

  2. David Lees

    Tino Lange Guest

    On Wed, 30 Jul 2003 05:35:02 GMT, David Lees
    <> wrote:

    >Flawless install and it ran my very simple minded (try not to laugh)
    >nested loop integer arithmetic benchmark twice as fast as 2.2.3
    >version 2.3 5.04 sec
    >version 2.2.3 9.77 sec



    Hi!

    By the way: What was/is the speed with 2.1.x on the same system?

    Cheers,

    Tino
     
    Tino Lange, Jul 30, 2003
    #2
    1. Advertising

  3. "David Lees"
    > Flawless install and it ran my very simple minded (try not to laugh)
    > nested loop integer arithmetic benchmark twice as fast as 2.2.3
    > version 2.3 5.04 sec
    > version 2.2.3 9.77 sec
    >
    > import time
    >
    > def speedTest(N):
    > t1 = time.time()
    > k = 0
    > for i in xrange(N):
    > for j in xrange(N):
    > k += (i+j)
    >
    > t2 = time.time()
    > return t2-t1
    >
    > print speedTest(3000)
    >
    > david lees


    You must really trust us.
    The benchmark compares the speed
    but doesn't check to see if the answers are the same ;-)


    Raymond Hettinger
     
    Raymond Hettinger, Jul 30, 2003
    #3
  4. On Wed, 30 Jul 2003 08:21:09 +0200, Tino Lange wrote:

    > On Wed, 30 Jul 2003 05:35:02 GMT, David Lees
    > <> wrote:
    >
    >> ....
    >>2.3 5.04 sec
    >>version 2.2.3 9.77 sec


    > ...
    > By the way: What was/is the speed with 2.1.x on the same system?
    >


    On 2.1.3 speedTest doesn't work . It gives OverflowError: integer
    addition . It 's because in that version integer aren't converted
    into Long Int when necessary .

    ....
    t1 = time.time()
    k = 0L
    ....
    for j in xrange(n):
    for i in xrange(n):
    k += i + j
    t1 = time.time()
    return t1 - t0
     
    Nicola Mingotti, Jul 30, 2003
    #4
  5. | You must really trust us.
    | The benchmark compares the speed
    | but doesn't check to see if the answers are the same

    Python 2.2.1 Python 2.3b1

    k ..... 26991000000 k ..... 26991000000

    et .... 108.370000005 et .... 51.4100000858

    Answers look OK and 2x speed improvement
    seems to prevail for slower processors as well ....

    Using Win98 @ 250 MHz ....

    --
    Cousin Stanley
    Human Being
    Phoenix, Arizona
     
    Cousin Stanley, Jul 30, 2003
    #5
  6. David Lees

    Aahz Guest

    In article <aOIVa.8149$>,
    David Lees <> wrote:
    >
    >Flawless install and it ran my very simple minded (try not to laugh)
    >nested loop integer arithmetic benchmark twice as fast as 2.2.3
    >version 2.3 5.04 sec
    >version 2.2.3 9.77 sec
    >
    >import time
    >
    >def speedTest(N):
    > t1 = time.time()
    > k = 0
    > for i in xrange(N):
    > for j in xrange(N):
    > k += (i+j)
    >
    > t2 = time.time()
    > return t2-t1
    >
    >print speedTest(3000)


    That primarily tests the speed of the warnings module. Test starting
    with 0L instead.
    --
    Aahz () <*> http://www.pythoncraft.com/

    This is Python. We don't care much about theory, except where it intersects
    with useful practice. --Aahz
     
    Aahz, Jul 30, 2003
    #6
  7. David Lees

    David Lees Guest

    Added initialization to a long and printout of both time and result.
    Looks like faith was justified, but good point Raymond.

    David Lees
    ------------
    import time

    def speedTest(N):
    t1 = time.time()
    k = 0L
    for i in xrange(N):
    for j in xrange(N):
    k += (i+j)

    t2 = time.time()
    return t2-t1,k

    print speedTest(3000)
    ---------
    Python 2.3
    >>> (5.406999945640564, 26991000000L)


    Python 2.2.3
    >>> (10.465000033378601, 26991000000L)
     
    David Lees, Jul 31, 2003
    #7
    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. Miguel Dias Moura
    Replies:
    1
    Views:
    410
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 1, 2004
  2. Miguel Dias Moura
    Replies:
    1
    Views:
    430
    Lars Netzel
    Jun 18, 2004
  3. Miguel Dias Moura
    Replies:
    2
    Views:
    351
    Martin
    Jun 22, 2004
  4. Shawn
    Replies:
    8
    Views:
    399
    Shawn
    Sep 21, 2006
  5. PETER WONG F H (+971 50 8320722)

    Please send you property detail to me,thank you !

    PETER WONG F H (+971 50 8320722), Mar 14, 2010, in forum: Python
    Replies:
    0
    Views:
    324
    PETER WONG F H (+971 50 8320722)
    Mar 14, 2010
Loading...

Share This Page