Re: Newbie completely confused

2007-09-25 Thread Roel Schroeven
Roel Schroeven schreef: > import time > > input_files = ["./test_file0.txt", "./test_file1.txt"] > > total_start = time.time() > data = {} > for input_fn in input_files: > file_start = time.time() > f = file(input_fn, 'r') > data[input_fn] = f.read() > f.close() > file_do

Re: Newbie completely confused

2007-09-25 Thread Roel Schroeven
Jeroen Hegeman schreef: > Thanks for the comments, > >> (First, I had to add timing code to ReadClasses: the code you posted >> doesn't include them, and only shows timings for ReadLines.) >> >> Your program uses quite a bit of memory. I guess it gets harder and >> harder to allocate the required

Re: Newbie completely confused

2007-09-24 Thread John Machin
On Sep 25, 1:51 am, Jeroen Hegeman <[EMAIL PROTECTED]> wrote: > > Your code does NOT include any statements that could have produced the > > above line of output -- IOW, you have not posted the code that you > > actually ran. > > Oh my, I must have cleaned it up a bit too much, hoping that people >

Re: Newbie completely confused

2007-09-24 Thread Istvan Albert
Two comments, > ... > self.item3 = float(foo[c]); c+=1 > self.item4 = float(foo[c]); c+=1 > self.item5 = float(foo[c]); c+=1 > self.item6 = float(foo[c]); c+=1 > ... this here (and your code in general) is mind boggling and not in a good way, as for you original question, I don't think that read

Re: Newbie completely confused

2007-09-24 Thread Jeroen Hegeman
> > Your code does NOT include any statements that could have produced the > above line of output -- IOW, you have not posted the code that you > actually ran. Oh my, I must have cleaned it up a bit too much, hoping that people would focus on the issue instead of the formatting of the output

Re: Newbie completely confused

2007-09-24 Thread Jeroen Hegeman
Thanks for the comments, > > (First, I had to add timing code to ReadClasses: the code you posted > doesn't include them, and only shows timings for ReadLines.) > > Your program uses quite a bit of memory. I guess it gets harder and > harder to allocate the required amounts of memory. Well, I gue

Re: Newbie completely confused

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > En Fri, 21 Sep 2007 13:34:40 -0300, Jeroen Hegeman > <[EMAIL PROTECTED]> escribi�: > >> class ModerateClass: >> def __init__(self): >> return >> def __del__(self): >> pass >> return >> >> class HugeCla

Re: Newbie completely confused

2007-09-22 Thread Roel Schroeven
Jeroen Hegeman schreef: > ...processing all 2 files found > --> 1/2: ./test_file0.txt > Now reading ... > DEBUG readLines A took 0.093 s > ...took 8.85717201233 seconds > --> 2/2: ./test_file0.txt > Now reading ... > DEBUG readLines A took 3.917 s > ...took 12.8725550175 seconds > > So the first t

Re: Newbie completely confused

2007-09-21 Thread Gabriel Genellina
En Fri, 21 Sep 2007 13:34:40 -0300, Jeroen Hegeman <[EMAIL PROTECTED]> escribi�: > So the first time around the file gets read in in ~0.1 seconds, the > second time around it needs almost four seconds! As far as I can see > this is related to 'something in memory being copied around' since if >

Re: Newbie completely confused

2007-09-21 Thread John Machin
On Sep 22, 2:34 am, Jeroen Hegeman <[EMAIL PROTECTED]> wrote: [snip] > ...processing all 2 files found > --> 1/2: ./test_file0.txt > Now reading ... > DEBUG readLines A took 0.093 s > ...took 8.85717201233 seconds Your code does NOT include any statements that could have produced the above line of

Newbie completely confused

2007-09-21 Thread Jeroen Hegeman
Dear Pythoneers, I'm moderately new to python and it got me completely lost already. I've got a bunch of large (30MB) txt files containing one 'event' per line. I open files after each other, read them line by line and from each line build a 'data structure' of a main class (HugeClass) cont