Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a7a268ba010024d1665d0d2b814b1a4ea6212a016ac6d2c1aeaed14c5ce6dd85
Ticket: e02798626dfbcd7b33db19e0fc3a9fb9fa0714f4
clock command is 8 times slower with Tcl 9.0b1
User & Date: sebres on 2024-02-27 16:44:41
Changes

  1. icomment:
    As for <code>string equal -length</code> (vs <code>regexp</code>), it would be many times slower, because <code>string equal -length</code> (with option) didn't compile in TEBC (including everything belonging: reenter to TEBCResume, NRE-trampoline, etc), whereas <code>regexp</code> is completely compiled in TEBC.<br/>
    (Let alone string equal with length would probably shimmer the string to unicode, what would introduce additional cost)
    
    You can try it by yourself (I guess slowing down by factor 10):
    <pre><code>timerate -calibrate {}
    proc test {ns} { timerate { regexp -- {^::oo::} $ns } }; test ::tcl::clock
    proc test {ns} { timerate { string equal -length 6 {::oo::} $ns } }; test ::tcl::clock
    proc test {ns} { timerate { regexp -- {^::oo::} $ns } }; test ::oo::test
    proc test {ns} { timerate { string equal -length 6 {::oo::} $ns } }; test ::oo::test
    </code></pre>
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"