Tcl Source Code

View Ticket
Login
Ticket UUID: 1025834
Title: unnecessary string copy in INST_CONCAT1
Type: Bug Created on: 2004-09-10 12:57:46
Submitter: msofer Assigned to: msofer
Subsystem: 47. Bytecode Compiler Severity:
Priority: 9 Immediate Last modified: 2004-10-31 03:46:47
Status: Closed Closed by: msofer
Resolution: Fixed Closed on: 2004-09-11 13:45:52
Version: None
Description:
INST_CONCAT1 will always copy the first item; this is
not necessary whenever it is unshared and its
string-rep has enough room for the appending. This
should be fixed by either duplicating code from
AppendUtfToUtfRep (in tclStringObj.c), or calling it.
User Comments:
msofer added on 2004-09-11 20:45:52:
Logged In: YES 
user_id=148712

Fix using Tcl_SetObjLength committed to HEAD.

dgp added on 2004-10-27 00:38:19:
Logged In: YES 
user_id=80530

backport?

msofer added on 2004-10-31 03:46:47:
Logged In: YES 
user_id=148712

This *has* been backported - lines 1266/78 in tclExecute.c
(albeit in a simplified version wrt to HEAD; this only fixes
enough to enbable the $x[set x{}] trick).

As that particular idiom is horribly expensive without this
patch, the backporting may however be questionable: scripts
optimised for 8.4.8 will be very bad in 8.4.x. See timings
at
http://groups.google.com.ar/groups?q=comp.lang.tcl+%22%24x%5Bset+x+%7B%7D%5D%22+msofer&hl=es&lr=&selm=2qdvlnFualfaU1%40uni-berlin.de&rnum=1

Maybe requires reverting the backport?