FAQ
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

Search Discussions

  • Tino Lange at Jul 30, 2003 at 6:21 am

    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
  • Nicola Mingotti at Jul 30, 2003 at 7:50 am

    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 at Jul 30, 2003 at 7:56 am

    On Wed, 30 Jul 2003 09:50:42 +0200, Nicola Mingotti wrote:
    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?
    Emacs Sequence in Pan ...
    Mail left before completion :)

    On my pc it works if i put k = 0L instead of k= 0
    ...
    t1 = time.time()
    k = 0L
    ...
    bye .
  • Raymond Hettinger at Jul 30, 2003 at 7:49 am
    "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
  • Cousin Stanley at Jul 30, 2003 at 12:15 pm

    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
  • David Lees at Jul 31, 2003 at 3:40 am
    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)
  • Aahz at Jul 30, 2003 at 2:02 pm
    In article <aOIVa.8149$yv1.7974 at nwrddc02.gnilink.net>,
    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 (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

    This is Python. We don't care much about theory, except where it intersects
    with useful practice. --Aahz

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 30, '03 at 5:35a
activeJul 31, '03 at 3:40a
posts8
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase