|
From: Brian G. <bri...@me...> - 2013-01-17 19:04:07
|
On Jan 17, 2013, at 10:57 AM, Porter, Don wrote: > > Remember that [string length] returns the number of characters in > the string. That information is not stored anywhere in the Tcl_Obj struct. > > (objPtr->length is in bytes, not chars) > > The shimmer happens so that we have someplace to store the computed > length in chars, so when it's asked for again we don't have to compute it again. > > Looking at the 8.4 source code, it does the same. You should not see any > difference in the shimmer pattern moving from 8.4 to 8.5. > > Tcl_GetCharLength() calls SetStringFromAny() which shimmers. Don't you > see that in your examples? That's not my experience, comparing 8.4.14 vs 8.5.8. And practically speaking we deal with simple ascii 99.999% of the time, iso8859-1 technically. Also, most of the [string length] operations only care about !=0 tests. -Brian |