Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2006-08-10
01:13 • Closed ticket [1530262fff]: Minor optimisation to BinaryProc plus 7 other ch... artifact: 6d811cfff0 user: dgp
2006-08-06
06:25 • Ticket [1530262fff]: 1 change artifact: 3b889c6ca7 user: dkf
2006-07-31
12:47 • Ticket [1530262fff]: 1 change artifact: 7e64d9bbf6 user: dgp
2006-07-28
16:54 • Add attachment tclEncoding.c-patch to ticket [1530262fffffffff|1530262f... artifact: 117fdbf3d8 user: afredd
16:54 • Ticket [1530262fff] Minor optimisation to BinaryProc status still Open with ... artifact: 89daa6496d user: afredd
09:54 • New ticket [1530262fff]. artifact: 70157a2a0c user: afredd

Minor optimisation to BinaryProc

Closed / Accepted1530262fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-07-28 09:54:33
Replacing the for loop in BinaryProc (which is used
to copy characters from one buffer to another) with
a memcpy provides a minor speed up.

Justication:
BinaryProc is often used on channelBuffer's
ie. srcLen is often 4096, and memcpy is much quicker
than a for loop in such cases (i measure it at
about 10x).

It seems like a memcpy() is faster that a for loop
whenever more than ~16 characters are copied, which
is probably the most common case in calls to
BinaryProc.
afreddplain2006-07-28 16:54:34
File Added - 186554: tclEncoding.c-patch
dgp Ticket [1530262fff]: 1 change [History diff]2006-07-31 12:47:47
dkf Ticket [1530262fff]: 1 change [History diff]2006-08-06 06:25:20
dgpplain2006-08-10 01:13:07
Logged In: YES 
user_id=80530


looks fine to me; tests ok.
memcpy() already used
throughout Tcl sources.

committed to both active
branches.
Log in (anonymous is fine) to add a comment.

Attachments: