Artifacts Associated With Ticket 3069593
Ticket change [70ec3427b2] (rid 100576) by ferrieux on 2010-09-17 22:54:49:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- 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. - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "7 High"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "ferrieux"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to:
Performance gap between [string equal] and [string compare]
- type initialized to: "Bug"
Ticket change [b9a8d6836d] (rid 129183) by hobbs on 2010-09-22 08:26:30:
- 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.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [36d4a7d77f] (rid 107173) by hobbs on 2010-09-25 09:26:38:
- closedate changed to: "2010-09-25T02:26:38"
- closer changed to: "hobbs"
- icomment:
allow_comments - 1 HEAD has all variations condensed into one path. Speedups for several cases.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"