------------UV8IwqfSUYyR4jschEmsFb
Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8
Content-Transfer-Encoding: 7bit

I have made some changes to the faulty patch to string.c that I posted  
last week, and the attached version seems to pass the tests (though there  
are a couple of failures, but these are the same ones as the vanilla 1.9 I  
checked out).

I had to make one change to a test of String#split because it now raises a  
different kind or error. Hope that's OK.

I know this is a big patch, but I am running out of time to split it into  
smaller chunks to make it easier to merge. I can try.

The main optimizations are:

- The CODERANGE flags were being cleared unnecessarilly in several places.  
This can cause the string to be re-scanned, which is inefficient. I think  
this was the main problem with the "count_words benchmark.

- Optimized String#split when the parameter is a string. Now about twice  
as fast

- Several other minor optimizations, mainly for single-byte character  
strings

Cheers
Mike

On Fri, 12 Sep 2008 02:16:51 +1000, NARUSE, Yui <naruse / airemix.jp> wrote:

> P.S.
> If you split your patch into small atomic patches,
> your patch will be merged rapidly.
>


------------UV8IwqfSUYyR4jschEmsFb
Content-Disposition: attachment; filename=string.patch
Content-Type: application/octet-stream; name=string.patch
Content-Transfer-Encoding: Base64

SW5kZXg6IHN0cmluZy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN0cmluZy5j
CShyZXZpc2lvbiAxOTA3MykKKysrIHN0cmluZy5jCSh3b3JraW5nIGNvcHkpCkBA
IC0xMTEsNyArMTExLDcgQEAKIAogI2RlZmluZSBTVFJfRU5DX0dFVChzdHIpIHJi
X2VuY19mcm9tX2luZGV4KEVOQ09ESU5HX0dFVChzdHIpKQogCi1zdGF0aWMgaW50
CitzdGF0aWMgaW5saW5lIGludAogc2luZ2xlX2J5dGVfb3B0aW1pemFibGUoVkFM
VUUgc3RyKQogewogICAgIHJiX2VuY29kaW5nICplbmMgPSBTVFJfRU5DX0dFVChz
dHIpOwpAQCAtMTA1Nyw2ICsxMDU3LDE3IEBACiAgICAgRU5DX0NPREVSQU5HRV9D
TEVBUihzdHIpOwogfQogCis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gPD0gMCkgeworCSAgICBsZW4gPSAwOworCSAgICBwID0g
MDsKKwl9CisJZWxzZQorCSAgICBwID0gcyArIGJlZzsKKwlnb3RvIHN1YjsKKyAg
ICB9CiAgICAgaWYgKGJlZyA8IDApIHsKIAlpZiAobGVuID4gLWJlZykgbGVuID0g
LWJlZzsKIAlpZiAoLWJlZyAqIHJiX2VuY19tYm1heGxlbihlbmMpIDwgUlNUUklO
R19MRU4oc3RyKSAvIDgpIHsKQEAgLTEzMDcsNyArMTMzMyw2IEBACiAgICAgZWxz
ZSBpZiAoYmVnID4gMCAmJiBiZWcgPiBzdHJfc3RybGVuKHN0ciwgZW5jKSkgewog
CXJldHVybiBRbmlsOwogICAgIH0KLSAgICBzaW5nbGVieXRlID0gc2luZ2xlX2J5
dGVfb3B0aW1pemFibGUoc3RyKTsKICAgICBpZiAobGVuID09IDApIHsKIAlwID0g
MDsKICAgICB9CkBAIC0xMzE4LDE3ICsxMzQzLDI0IEBACiAgICAgICAgIGxlbiA9
IHN0cl91dGY4X29mZnNldChwLCBlLCBsZW4pOwogICAgIH0KICNlbmRpZgotICAg
IGVsc2UgaWYgKChwID0gc3RyX250aChzLCBlLCBiZWcsIGVuYywgc2luZ2xlYnl0
ZSkpID09IGUpIHsKLQlsZW4gPSAwOwotICAgIH0KICAgICBlbHNlIGlmIChyYl9l
bmNfbWJtYXhsZW4oZW5jKSA9PSByYl9lbmNfbWJtaW5sZW4oZW5jKSkgewotICAg
ICAgICBpZiAobGVuICogcmJfZW5jX21ibWF4bGVuKGVuYykgPiBlIC0gcCkKKwlp
bnQgY2hhcl9zeiA9IHJiX2VuY19tYm1heGxlbihlbmMpOworCisJcCA9IHMgKyBi
ZWcgKiBjaGFyX3N6OworCWlmIChwID4gZSkgeworCSAgICBwID0gZTsKKwkgICAg
bGVuID0gMDsKKwl9CisgICAgICAgIGVsc2UgaWYgKGxlbiAqIGNoYXJfc3ogPiBl
IC0gcCkKICAgICAgICAgICAgIGxlbiA9IGUgLSBwO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