ANN: Gadfly bugfix test release

aaron_watters at my-deja.com aaron_watters at my-deja.com
Sun Aug 8 06:52:44 CEST 1999


In article <7ns85r$cla$1 at nnrp1.deja.com>,
  aaron_watters at my-deja.com wrote:
> Gadfly users and others: Please try one of the following
> files
>
>    http://www.chordate.com/kwParsing/kwPtest.tgz (tar/gz version)
>
> or
>
>    http://www.chordate.com/kwParsing/kwPtest.zip (zip version)
>
> I believe this replacement fixes the following longstanding bugs:

I just uploaded these *again*.  One new bug is fixed
[recovery problem that is impossible, that someone ran
into anyway] and an old bug that wasn't actually fixed
before [unique indices should correctly prevent non-unique
inserts] is now fixed, I think.

Please try it out.  I'll make it the official release
after it's stable.  Thanks for previous feedback!!

Two more comments:
  1) I just decided to go to the O'Reilly Open Source
     Conference: does anyone want a hotel roommate?

  2) In my efforts for gadfly 2 I came up with the following
     benchmark

def test():
    range1 = range(100, 30000)
    print "testing loop"
    from time import time
    now = time()
    result = range1[:]
    for i in range(len(range1)):
        result[i] = (range1[i], 'x')
    elapsed = time()-now
    print "elapsed", elapsed
    print;
    print "testing map"
    now = time()
    result = map(None, range1, ['x']*len(range1))
    elapsed = time()-now
    print "elapsed", elapsed

def test2():
    range1 = range(100, 30000)
    print "testing loop"
    from time import time
    now = time()
    result = range1[:]
    for i in range(len(range1)):
        result[i] = range1[i]-3
    elapsed = time()-now
    print "elapsed", elapsed
    print;
    print "testing map"
    now = time()
    from operator import sub
    result = map(sub, range1, [3]*len(range1))
    elapsed = time()-now
    print "elapsed", elapsed

test()
print
test2()

On my underpowered win95 machine this prints
testing loop
elapsed 1.10000002384

testing map
elapsed 0.330000042915

testing loop
elapsed 0.439999938011

testing map
elapsed 0.330000042915

Does this mean that map is always better than for
loops even when it looks stupid?  Inquiring minds
want to know.
   -- Aaron Watters

===
"Winston, you are drunk."
"And you madame are ugly, but I shall be sober in the morning."


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list