[Tutor] Windows vs Linux processing speed.

Prasad, Ramit ramit.prasad at jpmorgan.com
Fri Oct 14 19:15:40 CEST 2011


From: tutor-bounces+ramit.prasad=jpmorgan.com at python.org [mailto:tutor-bounces+ramit.prasad=jpmorgan.com at python.org] On Behalf Of Tony Pelletier
Sent: Friday, October 14, 2011 11:46 AM
To: tutor at python.org
Subject: [Tutor] Windows vs Linux processing speed.

Hi, 

I have a question regarding the speed of my program on linux in comparison to windows.

I'm using geopy and contacting Google for geocodes for records in a csv I created.  Like such:

 try:
        reader = csv.reader(open(filename, "r"))
        for row in reader:
            if row: # Checking to see if it's a valid row so it doesn't blow up on an empty row.
                username, address, address2, city, state, zip, country = row[0:7]
                location = address + ', ' + city + ' ' + state + ' ' + zip + ' ' + country
                try:
                    place, (lat, lng) =  g.geocode(location) # Contact Google for Geocodes

I mainly use windows, but I tend to use Arch Linux at home.  When I run it via windows, it's relatively slow and didn't really bother me, but when I ran it at home I got through 15 or so and got a message back from google saying  I was exceeding the allowed amount.  Or something to that effect.  Basically, I was exceeding the 10 per second that's allowed.  

So, my question is.  Why is it running so much faster on linux?  Is it the way that linux is handling the socket?  Does windows open and close it whereas linux might leave it open and just pump data through?  

It's not really a problem since I just added sleep time, but I'm curious.

Thanks
Tony
==================================================================================

I think you might get a better response for this question on the main Python list. You say that at home you use Arch Linux, which implies you are running it from Windows in a different physical location. My initial thought is that your original run might have been from a location "far" from Google or with network congestion. Have you tried Windows and Linux from the same location? What version of Windows and Python for each?

Not sure location should make *that* much of a difference though.

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list