From: Randy Kramer Date: 2006-05-24T02:44:04+09:00 Subject: Re: Zed and Luis drop the bomb on Ruby's poor performance On Monday 22 May 2006 05:45 pm, Sam Roberts wrote: > Quoting hutch@recursive.ca, on Tue, May 23, 2006 at 05:36:28AM +0900: > > Don't forget that string comparison is pretty quick if the strings > > differ in the first character. If you try comparing to the same > > string and make the string a lot longer (say 2000 characters) you'll > > get a situation where symbol comparisons are about three times faster > > than string comparisons. > > But the strings in my app are short, about 20 chars. > > > Have you tried profiling your code? > > Yes, performance was dominated by string comparisons, I wrote the > benchmark to see if changing to symbols would help. How long is your program (lines, for example)? Is it small enough to either post to the list or make available to those who might be interested. It would be interesting to see what others might suggest to improve the performance of your code. (For example, maybe there are ways to use fewer string comparisons?) If your program is (to pick an arbitrary number) 60 lines or less, post it. (And you're willing to ;-) If longer, post with the length of the program--maybe some people will be interested enough to request a copy to look at (with an eye to optimizing it). Randy Kramer