#479 Minor optimisation to BinaryProc

closed-accepted
5
2006-08-09
2006-07-28
afredd
No

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.

Discussion

  • afredd

    afredd - 2006-07-28

    Patch to tclEncoding

     
  • Don Porter

    Don Porter - 2006-07-31
    • assigned_to: nobody --> dgp
     
  • Donal K. Fellows

    • labels: --> 10. Objects
     
  • Don Porter

    Don Porter - 2006-08-09
    • status: open --> closed-accepted
     
  • Don Porter

    Don Porter - 2006-08-09

    Logged In: YES
    user_id=80530

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

    committed to both active
    branches.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks