Re: [Tutor] Understanding cProfile output

2012-09-20 Thread Dave Angel
On 09/20/2012 05:15 PM, ranveer raghuwanshi wrote: > Thanks for the input everyone. > > @Dave, I basically implemented the sieve of eratosthenes to fiind the > number of prime numbers in a given range. So, yes I am looking for > suggestions to speed it up. > Please don't top-post on this forum.

Re: [Tutor] Understanding cProfile output

2012-09-20 Thread ranveer raghuwanshi
Thanks for the input everyone. @Dave, I basically implemented the sieve of eratosthenes to fiind the number of prime numbers in a given range. So, yes I am looking for suggestions to speed it up. On Fri, Sep 21, 2012 at 2:16 AM, Dave Angel wrote: > On 09/20/2012 03:56 PM, Steven D'Aprano wrote:

Re: [Tutor] Understanding cProfile output

2012-09-20 Thread Dave Angel
On 09/20/2012 03:56 PM, Steven D'Aprano wrote: > On 21/09/12 04:58, ranveer raghuwanshi wrote: >> Hi, >> >> I am trying to understand the output of cProfile when run against my >> python >> code. The code is: > [...] >> What the above code does is it counts the number of prime numbers >> less than

Re: [Tutor] Understanding cProfile output

2012-09-20 Thread Steven D'Aprano
On 21/09/12 04:58, ranveer raghuwanshi wrote: Hi, I am trying to understand the output of cProfile when run against my python code. The code is: [...] What the above code does is it counts the number of prime numbers less than 1,00,000. Now when I profile this code using *python -m cProfile -

[Tutor] Understanding cProfile output

2012-09-20 Thread ranveer raghuwanshi
Hi, I am trying to understand the output of cProfile when run against my python code. The code is: from math import floor,sqrt count = int(floor(sqrt(10))) max_check = range(2,count+1) original_list = range(2,11) for j in max_check: temp_list=[] for i in original_list: if