[wingide-users] Performance running code in Wing

Jan jan.jansen at gmx.de
Thu Jan 28 13:19:31 MST 2010


Hello,

when I execute some code from Wing it's about 4 times slower than 
running from the command line. I wonder if this is normal or it there's 
something buggy going on?

I'm on a i7-860 machine with windows 7-64 bit and python 2.6.4 (32 bit). 
I've seen this on Wing 3.2.3 and 3.2.4

Kind regards,

Jan

Here's the code:

from math import *
import time

radius = 6371

def distance(latA, lngA, latB, lngB):
     latAr = radians(latA)
     lngAr = radians(lngA)
     latBr = radians(latB)
     lngBr = radians(lngB)

     deltaLat = latBr - latAr
     deltaLng = lngBr - lngAr

     return radius * 2 * asin(sqrt(
             sin(deltaLat/2)**2 + cos(latAr)
             * cos(latBr) * (sin(deltaLng/2)**2)))

def bench():
     increment = 10

     start = time.time()
     latA = -90
     while(latA <= 90):
         lngA = -180
         while(lngA <= 180):
             latB = -90
             while(latB <= 90):
                 lngB = -180
                 while(lngB <= 180):
                     distance(latA, lngA, latB, lngB)
                     lngB = lngB + increment
                 latB = latB + increment
             lngA = lngA + increment
         latA = latA + increment
     end = time.time()
     print end-start

if __name__ == '__main__':
     bench()


More information about the wingide-users mailing list