<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 10/14/2011 12:45 PM, Tony Pelletier wrote:
    <blockquote
cite="mid:CAOjO5CN=Sq_ax=wHyQ7q4yOJkKwYeX3JuipiAdPGNcegvfUz=Q@mail.gmail.com"
      type="cite">Hi,&nbsp;
      <div><br>
      </div>
      <div>I have a question regarding the speed of my program on linux
        in comparison to windows.<br>
      </div>
    </blockquote>
    [snip]<br>
    <br>
    Speed of a pure Python program depends on <br>
    <ul>
      <li>processor speed</li>
      <li>competition for resources from other processes</li>
      <li>perhaps RAM</li>
    </ul>
    A good starting point -create a benchmark program that uses only CPU
    - no disk, no internet.<br>
    Example:<br>
    <br>
    import time<br>
    n = 100000 # a guess<br>
    start = time.time()<br>
    for i in range(n):pass<br>
    print time.time() - start<br>
    <br>
    Be sure n is large enough to create a run time of at least several
    seconds.<br>
    <br>
    Run it on Linux and on Windows.<br>
    <br>
    Do a speed check on your internet connections.<br>
    <br>
    Then modify the program to open &amp; read the csv file inside the
    loop. You will have to reduce n when you add disk i/o<br>
    <br>
    import time, csv<br>
    n = 10000 # a guess<br>
    start = time.time()<br>
    for i in range(n):<br>
    &nbsp; for line in csv.reader(open(filename, "r")):pass<br>
    print time.time() - start<br>
    HTH<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bob Gailer
919-636-4239
Chapel Hill NC</pre>
  </body>
</html>