On Saturday, May 1, 2004, at 06:16 US/Eastern, Tab Julius wrote:


Well, unless the string is changing in size right under your nose, you don't need to calculate the number of chars every single time. That's one small optimization you can do...

numChars =the number of chars in reallyBigString
repeat with x=1 to numChars

Ah, Tab. That's something I haven't done. Hm, and that's a hint from your old "Lingo" book, isn't it?


...

I doubt the size of the string has anything to do with it directly (meaning, breaking it up won't help). All you've got is a starting point of the string and an index into the string. It doesn't walk the string, it just adds the index to the starting point, so having separate smaller strings wouldn't do much (well, let me qualify - you say 'really big string' - what constitutes to you a really big string? Are we talking a couple thousand chars, or are you talking tens of thousands of chars?).

Yes, they can be as much as tens of thousands. I'm working on a "small" one right now which is 68000 chars. :-)



The size of the does have something to do with it only from the point of view that you have to do the operation x times over. Breaking up the string won't get you anyway, you'd still have to do it just as many times.

Bringing in the chunks and operating on the smaller strings made a significant speed difference...perhaps I'm looking in the wrong place?



If you want to explain what you're trying to do (the larger picture) there might be another way to accomplish it.

Conceptually, what I'm trying to do is pretty simple: I'm reading in chars from encrypted (XOR) binary files, converting chars to ASCII codes, XORing the integer vals, then writing decrypted chars back out to files.



But for now, take the number of chars out of the loop as suggested at top.

Will do. Thanks again.


[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to