From: Lloyd Zusman Date: 2004-08-04T09:51:51+09:00 Subject: Re: Fastest way to reverse-process a string? "Mehr, Assaph (Assaph)" writes: > [ ... ] > > Sorry, didn't mean to imply anything. I just had wanted to show the > performance of the obvious ways I knew (as I couldn't think of anything > smarter). Well, I too am sorry: for having misinterpreted the intent of your message. That's one of the hazards of communicating in writing. Without our being able to see each other's facial expressions or hear each other's tone of voice, sometimes these temporary misunderstandings occur. >> Thank you for these suggestions. > > BTW, I also tried Simon's Iterator::Reverse (about 13 seconds) and an > explicit idx-- type loop (about 3 seconds). I just wanted to show that > the reverse.each_byte (as explained by Joel) creates less objects and > seems fastest. [ ... ] Yes, that does indeed seem fastest of the algorithms mentioned so far. And now, if only there were a String#reverse_each_byte ... so I can avoid the 'reverse' altogether. > [ ... ] Sorry for not making myself clear :( And I'm sorry for not correctly interpreting your words. So all is well. :) And thanks again. -- Lloyd Zusman ljz@asfast.com God bless you.