Skip to content
Tcl Source Code History Of Ticket 3069593
Login

History Of Ticket 3069593

Artifacts Associated With Ticket 3069593

  1. Ticket change [70ec3427b2] (rid 100576) by ferrieux on 2010-09-17 22:54:49:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The "streq" and "strcmp" instructions could benefit from a bit of unification (as suggested by a comment in tclExecute.c).
      
      For example, [string compare] has very efficient special cases for ByteArray and String operands, that [string equal] lacks.
      As a consequence, a naive test of equality on big byte arrays with [string equal] is ~7 times slower than the less obvious [string compare], despite the fact that the latter produces a more elaborate result (three-valued instead of binary):
      
      Source this:
      
        set z [open /dev/zero r]
        fconfigure $z -translation binary
        set b1 [read $z 1000000]
        set b2 [read $z 1000000]
        set y 1
      
      Then interactively:
      
        % time {string compare $b1 $b2} 1000
        301.596 microseconds per iteration
        % time {string compare $b1 $b2} 1000
        299.637 microseconds per iteration
        % time {string compare $b1 $b2} 1000
        298.203 microseconds per iteration
        % ::tcl::unsupported::representation  $b1
        value is a bytearray with a refcount of 2, object pointer at 0x9b55e50, internal representation 0xb69ae010:0x9b56fc0, no string representation.
        % ::tcl::unsupported::representation  $b2
        value is a bytearray with a refcount of 2, object pointer at 0x9b56e58, internal representation 0xb68ac010:0x9b55e50, no string representation.
        % time {string equal $b1 $b2} 1000
        2159.225 microseconds per iteration
        % time {string equal $b1 $b2} 1000
        2128.354 microseconds per iteration
        % time {string equal $b1 $b2} 1000
        2129.929 microseconds per iteration
        % ::tcl::unsupported::representation  $b1
        value is a bytearray with a refcount of 2, object pointer at 0x9b55e50, internal representation 0xb69ae010:0x9b56fc0, no string representation.
        % ::tcl::unsupported::representation  $b2
        value is a bytearray with a refcount of 2, object pointer at 0x9b56e58, internal representation 0xb68ac010:0x9b55e50, no string representation.
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "7 High"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "ferrieux"
    10. subsystem initialized to: "18. Commands M-Z"
    11. title initialized to:
      Performance gap between [string equal] and [string compare]
      
    12. type initialized to: "Bug"
  2. Ticket change [b9a8d6836d] (rid 129183) by hobbs on 2010-09-22 08:26:30:

    1. icomment:
      memcmp used in INST_STR_(N)EQ now.  Note that better libc's were not effected by this disparity.  INST_STR_(N)EQ could be improved with obj-type-aware, but that's not critical.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  3. Ticket change [36d4a7d77f] (rid 107173) by hobbs on 2010-09-25 09:26:38:

    1. closedate changed to: "2010-09-25T02:26:38"
    2. closer changed to: "hobbs"
    3. icomment:
      
      
      allow_comments - 1
      
      HEAD has all variations condensed into one path.  Speedups for several cases.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"