Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-11-23
14:24 • Closed ticket [1064243fff]: use memmove() in Tcl_ListObjReplace() plus 2 oth... artifact: 45dada9aa4 user: hobbs
2004-11-12
16:29 • Pending ticket [1064243fff]. artifact: bb90e066b0 user: das
16:28 • Open ticket [1064243fff]. artifact: 94bd5a114c user: das
16:09 • Ticket [1064243fff]: 6 changes artifact: 875e076618 user: dkf
2004-11-11
23:16 • Pending ticket [1064243fff]. artifact: 26827fee96 user: hobbs
08:23 • Open ticket [1064243fff]. artifact: b47bbb06b9 user: das
08:22 • Pending ticket [1064243fff]. artifact: 6329f81c37 user: das
08:12 • Add attachment perf-tweak-core-8-4-branch.diff to ticket [1064243ffffff... artifact: 2f5d515953 user: das
08:12 • Ticket [1064243fff] use memmove() in Tcl_ListObjReplace() status still Open ... artifact: 040dc02152 user: das
08:11 • Ticket [1064243fff]: 4 changes artifact: 562e036fe5 user: das
08:11 • Add attachment perf-tweak-HEAD.diff to ticket [1064243fffffffff|1064243... artifact: 3d19703202 user: das
01:11 • New ticket [1064243fff] use memmove() in Tcl_ListObjReplace(). artifact: b73be1de71 user: das

use memmove() in Tcl_ListObjReplace()

Closed / Fixed1064243fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-11-11 01:11:58
Tcl_ListObjReplace() should use memmove() instead
of a manual copy loop to shift list elements in memory.
The attached patch decreases time spent inTcl_ListObjReplace() 
from 5.2% to 1.7% of overall runtime of
tclbench on a ppc 7455 (i.e. 200% speed increase).

also contained in the patch a small performance tweak to tclHash.c: 
this hoists a few constant pointer dereferences out
of loops to eliminate redundant loads that the gcc optimizer didn't
deal with. Decreases time spend in Tcl_FindHashEntry() by 10% 
over a full run of the tcl testuite on a ppc 7455.
dasplain2004-11-11 08:11:59
File Added - 108374: perf-tweak-HEAD.diff
dasplain2004-11-11 08:12:42
File Added - 108375: perf-tweak-core-8-4-branch.diff
dasplain2004-11-11 08:22:39
Logged In: YES 
user_id=90580

Jeff,
went ahead and committed this to HEAD and core-8-4-branch, hope that's 
ok, the changes are minor and should not be controversial.
das Open ticket [1064243fff]. [History diff]2004-11-11 08:23:09
hobbsplain2004-11-11 23:16:33
Logged In: YES 
user_id=72656

Sounds good to me.
dkfplain2004-11-12 16:09:59
Logged In: YES 
user_id=79902

The only thing to watch out for is whether memmove() is
going to have any additional requirements on the configure
script and portability. Apart from that, no objection
whatsoever. :^)
dasplain2004-11-12 16:28:00
Logged In: YES 
user_id=90580

but memmove() is already used in a number of places in the core (in 
tclParseExpr.c, tclIOGT.c, tclIO.c) so this does not create a new 
dependency, configure and compat/string.h already deal with it...
das Pending ticket [1064243fff]. [History diff]2004-11-12 16:29:11
hobbs Closed ticket [1064243fff]. [History diff]2004-11-23 14:24:40
Log in (anonymous is fine) to add a comment.

Attachments: