Artifacts Associated With Ticket 219109ffffffffff
Ticket change [0970544aff] (rid 113653) by nobody on 2000-10-26 01:10:55:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 6018 RFE Version: 8.3.1 SubmitDate: '2000-07-18' LastModified: '2000-09-26' Severity: LOW Status: Released Submitter: techsupp ChangedBy: hobbs OS: All FixedDate: '2000-09-26' FixedInVersion: 8.4a2 ClosedDate: '2000-10-25' Name: Bob Techentin Comments: It would probably be even more efficient to copy the guts of AppendUtfToUtfRep (in tclStringObj.c) but that might be reaching down to too low a level for this command. I tried it and got 75% speedup, but it core dumps in the corner cases in the test suite. DesiredBehavior: The new [string repeat] command will iteratively call Tcl_AppendToObj() to build up a repeating string. This causes several calls to reallocate more memory for the result object. It is more efficient to call Tcl_SetObjLength() once before the appends, so that it is not necessary to reallocate memory while building up the string. This results in about a 20% speedup on my system, and reduces the chances of the automatic allocator using too much memory (it doubles the object length each time). Patch: *** tclCmdMZ.c.orig Mon Jul 17 14:51:48 2000 --- tclCmdMZ.c Mon Jul 17 15:26:56 2000 *************** *** 1823,1828 **** --- 1823,1829 ---- string1 = Tcl_GetStringFromObj(objv[2], &length1); if (length1 > 0) { + Tcl_SetObjLength(resultPtr, count*length1); for (index = 0; index < count; index++) { Tcl_AppendToObj(resultPtr, string1, length1); } PatchFiles: tclCmdMZ.c That simple fix unfortunately doesn't have the desired effect, but I've changed around 8.4a2 to use ckalloc directly for the same effect. -- 09/26/2000 hobbs - foundin initialized to: "obsolete: 8.3.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "81. Bundled Packages"
- title initialized to: "string repeat speedup by pre-allocating TclObj"
- type initialized to: "RFE"
Ticket change [abb3b91f67] (rid 101160) by welch on 2000-10-26 08:34:57:
- closedate changed to: "2000-10-26T01:34:57"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [8fbd2b4c55] (rid 120322) by dgp on 2001-04-05 08:01:24:
- foundin changed to: "None"
- status changed to: "Open"
- subsystem changed to: "None"
Ticket change [4c073d0892] (rid 126808) by dkf on 2001-06-26 05:50:48:
- assignee changed to: "dkf"
- closedate changed to: "2001-06-25T22:50:48"
- closer changed to: "dkf"
- status changed to: "Closed"
- subsystem changed to: "18. Commands M-Z"