Tcl Source Code

View Ticket
Login
Ticket UUID: 1530262
Title: Minor optimisation to BinaryProc
Type: Patch Version: None
Submitter: afredd Created on: 2006-07-28 09:54:33
Subsystem: 10. Objects Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-08-10 01:13:07
Resolution: Accepted Closed By: dgp
    Closed on: 2006-08-09 18:13:07
Description:
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.
User Comments: dgp added on 2006-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.

afredd added on 2006-07-28 16:54:34:

File Added - 186554: tclEncoding.c-patch

Attachments: