From: Brent Roman Date: 2008-01-07T15:21:34+09:00 Subject: Re: multibyte strings & bucket-of-bytes efficiency under 1.9.0 Martin, The did some analysis of the log parsing application in which I observe a 5% slowdown under ruby 1.9. It comes down to regex performance. In fact, my log reader app spends > 50% of its runtime processing regex's. The strings are all US-ASCII encoded. Per your request, I've distilled the most common regex into the attached simple benchmark: http://www.nabble.com/file/p14659564/regexbench.rb regexbench.rb It merely scans a test string repeatedly for an escape sequence it does not contain. Ruby16 takes 9.3 seconds Ruby18 takes 9.7 seconds Ruby19 takes 12.8 seconds Ruby19 takes 18.0 seconds if the string encoding is forced to UTF-8 So, in "US-ASCII" regexes are about 25% slower Are you able to confirm these benchmarks? Are you surprised by this? Would you agree that some of this slowdown is the result of the new "encoding aware" regex engine in ruby19? Or, is it a "bug" that can be easily fixed? I included the UTF-8 case for comparison only. It shows a 50% slowdown. I suspect that the folks observing huge slowdowns in string performance are using UTF-8 or other multi-byte encodings. - brent Martin Duerst wrote: > > At 05:29 08/01/04, Michal Suchanek wrote: > > As Akira Tanaka and myself have already said, please provide > examples of actual code and actual performance figures, so that > we can look at the details. > > -- View this message in context: http://www.nabble.com/multibyte-strings---bucket-of-bytes-efficiency-under-1.9.0-tp14528798p14659564.html Sent from the ruby-core mailing list archive at Nabble.com.