Shane O'Connor wrote:
Hi,
First-time poster here. I've a question about loop efficiency - I was
wondering whether this code:
i = 0
while i < 1000:
do something
i+=1
is more efficient than:
for i in range(1000):
do something
or:
for i in xrange(1000):
do something
You can
On Thu, Mar 17, 2011 at 8:45 AM, Stefan Behnel wrote:
> Note that a web application involves many things outside of your own code
> that seriously impact the performance and/or resource requirements. Database
> access can be slow, excessively dynamic page generation and template engines
> can bec
Shane O'Connor, 17.03.2011 01:32:
In particular, I'm using Python 2.4.3 on a web server which needs to run as
fast as possible using as little memory as possible (no surprises there!).
Note that a web application involves many things outside of your own code
that seriously impact the performan
"Shane O'Connor" wrote
First-time poster here. I've a question about loop efficiency - I
was
wondering whether this code:
i = 0
while i < 1000:
do something
i+=1
is more efficient than:
for i in range(1000):
do something
It is impossible to tell and 99% of the time irrelevant si
On 03/16/2011 08:32 PM, Shane O'Connor wrote:
> Hi,
>
> First-time poster here. I've a question about loop efficiency - I was
> wondering whether this code:
>
> i = 0
> while i < 1000:
> do something
> i+=1
>
> is more efficient than:
>
> for i in range(1000):
> do something
>
> or
On Wed, Mar 16, 2011 at 7:32 PM, Shane O'Connor wrote:
> Hi,
>
> First-time poster here. I've a question about loop efficiency - I was
> wondering whether this code:
>
> i = 0
> while i < 1000:
> do something
> i+=1
>
> is more efficient than:
>
> for i in range(1000):
> do something
>
Hi,
First-time poster here. I've a question about loop efficiency - I was
wondering whether this code:
i = 0
while i < 1000:
do something
i+=1
is more efficient than:
for i in range(1000):
do something
or:
for i in xrange(1000):
do something
In my mind, the while loop should