I could use some help making this Python code run faster using only Python code.

2007-09-20 Thread Python Maniac
I am new to Python however I would like some feedback from those who know more about Python than I do at this time. def scrambleLine(line): s = '' for c in line: s += chr(ord(c) | 0x80) return s def descrambleLine(line): s = '' for c in line: s += chr(ord(c) &

Re: I could use some help making this Python code run faster using only Python code.

2007-09-20 Thread Python Maniac
On Sep 20, 3:57 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > On 9/20/07, Python Maniac <[EMAIL PROTECTED]> wrote: > > > I am new to Python however I would like some feedback from those who > > know more about Python than I do at this time. > > Well

Re: I could use some help making this Python code run faster using only Python code.

2007-09-21 Thread Python Maniac
On Sep 21, 12:56 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> wrote: > > It has to do with the input string length; try multiplying it by 10 or > > 100. Below is a more complete benchmark; for largish strings, the imap > > version is the fastest among those using

Re: I could use some help making this Python code run faster using only Python code.

2007-09-21 Thread Python Maniac
On Sep 21, 3:02 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > > Now I think I will code this little scrambler using nothing but the D > > Language just to see whether there is any benefit in using D over > > Python for this sort of problem. > > Isn't D compiled to machine code? I would expect it

Re: I could use some help making this Python code run faster using only Python code.

2007-09-21 Thread Python Maniac
On Sep 21, 4:48 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > > It would be nice if Python could be made to automatically detect the > > LC and string translation patterns used by the unoptimized Python code > > and make them into optimized Python code on the fly at runtime. I am > > more than

Re: I could use some help making this Python code run faster using only Python code.

2007-09-22 Thread Python Maniac
On Sep 21, 11:39 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 21 Sep 2007 16:25:20 -0700, Python Maniac wrote: > > On Sep 21, 3:02 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > > >> Isn't D compiled to machine code?

Re: I could use some help making this Python code run faster using only Python code.

2007-09-22 Thread Python Maniac
On Sep 21, 12:56 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> wrote: > > It has to do with the input string length; try multiplying it by 10 or > > 100. Below is a more complete benchmark; for largish strings, the imap > > version is the fastest among those using