[EMAIL PROTECTED] wrote:
> ... When I first translated it to Python verbatim,
> the Python script took almost 30 secs to run.
> So far, the best I can do is 11.2 secs using this:
> 
> from random import randrange
> from itertools import imap, repeat
> from operator import getitem, add, getslice
> 
> result = 0
> zeros = [0]*100
> for i in xrange (100000):
>     s = [chr(randrange(128))] * 1024
This doesn't do what you think it does, I'll wager.
Try:
       s = chr(randrange(128)) * 1024
to get an equivalent result.
or try:
       s = ''.join([chr(randrange(128)) for i in range(1024)])

-Scott
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to