On 10/14/2011 12:45 PM, Tony Pelletier wrote:
Hi,

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

Speed of a pure Python program depends on

 * processor speed
 * competition for resources from other processes
 * perhaps RAM

A good starting point -create a benchmark program that uses only CPU - no disk, no internet.
Example:

import time
n = 100000 # a guess
start = time.time()
for i in range(n):pass
print time.time() - start

Be sure n is large enough to create a run time of at least several seconds.

Run it on Linux and on Windows.

Do a speed check on your internet connections.

Then modify the program to open & read the csv file inside the loop. You will have to reduce n when you add disk i/o

import time, csv
n = 10000 # a guess
start = time.time()
for i in range(n):
  for line in csv.reader(open(filename, "r")):pass
print time.time() - start
HTH

--
Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to