Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9d9f163734bf1ded9fb2d63faf3f152ad3de123dcb1831a16363d581d990bf42
Ticket: e02798626dfbcd7b33db19e0fc3a9fb9fa0714f4
clock command is 8 times slower with Tcl 9.0b1
User & Date: oehhar on 2024-02-27 17:47:58
Changes

  1. icomment:
    Wow, I would never have thought this.
    The shimmering between utf8 and UNICODE is quite new to me and is an important fact.
    You learn each day, thank you so much.
    
    Here are the results on my tcl 8.6.13:
    
    <verbatim>
    % proc test {ns} { timerate { regexp -- {^::oo::} $ns } }; test ::tcl::clock
    0.105722 µs/# 5368601 # 9458756 #/sec 567.580 net-ms
    % proc test {ns} { timerate { string equal -length 6 {::oo::} $ns } }; test ::tcl::clock
    0.642979 µs/# 1382123 # 1555260 #/sec 888.676 net-ms
    % proc test {ns} { timerate { regexp -- {^::oo::} $ns } }; test ::oo::test
    0.188651 µs/# 3714746 # 5300782 #/sec 700.792 net-ms
    5 % proc test {ns} { timerate { string equal -length 6 {::oo::} $ns } }; test ::oo::test
    0.659135 µs/# 1351934 # 1517139 #/sec 891.107 net-ms
    % expr 0.642979/0.105722
    6.081789977488129
    % expr 0.659135/0.188651
    3.4939385425998273
    </verbatim>
    
    So factor 6 and 3.5 faster for regexp, incredibble.
    I also tried "string match {::oo::*}" which is close to regexp.
    
    TIP 688 is started and may be improved : [https://core.tcl-lang.org/tips/doc/trunk/tip/688.md]
    
    Thank you, you guys rock!
    Harald
    
  2. login: "oehhar"
  3. mimetype: "text/x-fossil-wiki"
  4. username: "oehhar"