From: "C. Dagnon" Date: 2009-03-06T01:46:30+09:00 Subject: Re: Any solutions to Ruby's inconsistencies? I単aki Baz Castillo wrote: > El Mi辿rcoles, 4 de Marzo de 2009, C. Dagnon escribi坦: >> I had been doing that, but then I thought that compiling a single regex >> would be less expensive than downcasing everything every time they got >> compared. > > Let's do some benchmarks: > ... > Did you know the String#casecmp method? It seems to be the faster way. Nope, didn't hear about that, nor Benchmark.realtime. Thanks - these look useful! My only suggestion would be that we try it against 100, 10,000, and larger sets of strings to see which is faster - this is over a collection after all. I wasn't assuming a Regexp.compile would be faster than other things for a single string compare. -- Posted via http://www.ruby-forum.com/.