Skip to content
Tcl Source Code History Of Ticket 52fd769456
Login

History Of Ticket 52fd769456

Artifacts Associated With Ticket 52fd769456

  1. Ticket change [8d337d5086] (rid 215908) by chrstphrchvz on 2023-06-26 01:02:57:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      In cmdMZ.test, <tt>_nrt_sleep 0.01</tt> should take at least 10µs to run. But cmdMZ-6.6 assumes that <tt>timerate {_nrt_sleep 0.01} 50</tt> will run <tt>_nrt_sleep 0.01</tt> at least 500 times, with an average time less than 100µs and at a rate greater than 10000 times per second; this is not the case on one of my systems which is running IA-32 (32-bit x86) Linux on a single-core 1.73GHz Pentium M. Are such performance requirements truly necessary for this test?
      
      <pre>
      ==== cmdMZ-6.6 Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument FAILED
      ==== Contents of test case:<br />
          set m1 &#91;timerate {_nrt_sleep 0.01} 50&#93;
          set m2 &#91;timerate {_nrt_sleep 1.00} 50&#93;
          list &#91;list \
      	&#91;expr {&#91;lindex $m1 0&#93; &lt; &#91;lindex $m2 0&#93;}&#93; \
      	&#91;expr {&#91;lindex $m1 0&#93; &lt; 100}&#93; \
      	&#91;expr {&#91;lindex $m2 0&#93; &gt; 100}&#93; \
      	&#91;expr {&#91;lindex $m1 2&#93; &gt; 500}&#93; \
      	&#91;expr {&#91;lindex $m2 2&#93; &lt; 500}&#93; \
      	&#91;expr {&#91;lindex $m1 4&#93; &gt; 10000}&#93; \
      	&#91;expr {&#91;lindex $m2 4&#93; &lt; 10000}&#93; \
      	&#91;expr {&#91;lindex $m1 6&#93; &gt; 5 && &#91;lindex $m1 6&#93; &lt; 100}&#93; \
      	&#91;expr {&#91;lindex $m2 6&#93; &gt; 5 && &#91;lindex $m2 6&#93; &lt; 100}&#93; \
          &#93; $m1 $m2; # interesting only in error case.<br />
      ---- Result was:
      {1 0 1 0 1 0 1 1 1} {108.017 µs/# 463 # 9257.8 #/sec 50.012 net-ms} {1093.13 µs/# 46 # 914.80 #/sec 50.284 net-ms}
      ---- Result should have been (glob matching):
      {1 1 1 1 1 1 1 1 1} *
      ==== cmdMZ-6.6 FAILED
      </pre>
      
    5. foundin initialized to: "8.6.13"
    6. is_private initialized to: "0"
    7. login: "chrstphrchvz"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "6133eb3026f9b10aa9b7b48da92ae2834fc225b0"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "chrstphrchvz"
    14. subsystem initialized to: "06. Time Measurement"
    15. title initialized to: "cmdMZ-6.6 fails on low performance system"
    16. type initialized to: "Bug"
  2. Ticket change [dfe2c7a386] (rid 215909) by chrstphrchvz on 2023-06-26 01:04:46:

    1. comment changed to:
      In cmdMZ.test, <tt>_nrt_sleep 0.01</tt> should take at least 10µs to run. But cmdMZ-6.6 assumes that <tt>timerate {_nrt_sleep 0.01} 50</tt> will run <tt>_nrt_sleep 0.01</tt> more than 500 times, with an average time less than 100µs and at a rate greater than 10000 times per second; this is not the case on one of my systems which is running IA-32 (32-bit x86) Linux on a single-core 1.73GHz Pentium M. Are such performance requirements truly necessary for this test?
      
      <pre>
      ==== cmdMZ-6.6 Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument FAILED
      ==== Contents of test case:<br />
          set m1 &#91;timerate {_nrt_sleep 0.01} 50&#93;
          set m2 &#91;timerate {_nrt_sleep 1.00} 50&#93;
          list &#91;list \
      	&#91;expr {&#91;lindex $m1 0&#93; &lt; &#91;lindex $m2 0&#93;}&#93; \
      	<span style="color:firebrick">&#91;expr {&#91;lindex $m1 0&#93; &lt; 100}&#93; \</span>
      	&#91;expr {&#91;lindex $m2 0&#93; &gt; 100}&#93; \
      	<span style="color:firebrick">&#91;expr {&#91;lindex $m1 2&#93; &gt; 500}&#93; \</span>
      	&#91;expr {&#91;lindex $m2 2&#93; &lt; 500}&#93; \
      	<span style="color:firebrick">&#91;expr {&#91;lindex $m1 4&#93; &gt; 10000}&#93; \</span>
      	&#91;expr {&#91;lindex $m2 4&#93; &lt; 10000}&#93; \
      	&#91;expr {&#91;lindex $m1 6&#93; &gt; 5 && &#91;lindex $m1 6&#93; &lt; 100}&#93; \
      	&#91;expr {&#91;lindex $m2 6&#93; &gt; 5 && &#91;lindex $m2 6&#93; &lt; 100}&#93; \
          &#93; $m1 $m2; # interesting only in error case.<br />
      ---- Result was:
      {1 0 1 0 1 0 1 1 1} {108.017 µs/# 463 # 9257.8 #/sec 50.012 net-ms} {1093.13 µs/# 46 # 914.80 #/sec 50.284 net-ms}
      ---- Result should have been (glob matching):
      {1 1 1 1 1 1 1 1 1} *
      ==== cmdMZ-6.6 FAILED
      </pre>
      
    2. login: "chrstphrchvz"
    3. mimetype: "text/plain"
  3. Ticket change [21019dc046] (rid 215910) by chrstphrchvz on 2023-06-26 01:06:59:

    1. comment changed to:
      In cmdMZ.test, <tt>_nrt_sleep 0.01</tt> should take at least 10µs to run. But cmdMZ-6.6 assumes that <tt>timerate {_nrt_sleep 0.01} 50</tt> will run <tt>_nrt_sleep 0.01</tt> more than 500 times, with an average time less than 100µs and at a rate greater than 10000 times per second; this is not the case on one of my systems which is running IA-32 (32-bit x86) Linux on a single-core 1.73GHz Pentium M. Are such performance requirements truly necessary for this test?
      
      <pre>
      ==== cmdMZ-6.6 Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument FAILED
      ==== Contents of test case:<br />
          set m1 &#91;timerate {_nrt_sleep 0.01} 50&#93;
          set m2 &#91;timerate {_nrt_sleep 1.00} 50&#93;
          list &#91;list \
      	&#91;expr {&#91;lindex $m1 0&#93; &lt; &#91;lindex $m2 0&#93;}&#93; \
      	<span style="color:firebrick">&#91;expr {&#91;lindex $m1 0&#93; &lt; 100}&#93; \</span>
      	&#91;expr {&#91;lindex $m2 0&#93; &gt; 100}&#93; \
      	<span style="color:firebrick">&#91;expr {&#91;lindex $m1 2&#93; &gt; 500}&#93; \</span>
      	&#91;expr {&#91;lindex $m2 2&#93; &lt; 500}&#93; \
      	<span style="color:firebrick">&#91;expr {&#91;lindex $m1 4&#93; &gt; 10000}&#93; \</span>
      	&#91;expr {&#91;lindex $m2 4&#93; &lt; 10000}&#93; \
      	&#91;expr {&#91;lindex $m1 6&#93; &gt; 5 && &#91;lindex $m1 6&#93; &lt; 100}&#93; \
      	&#91;expr {&#91;lindex $m2 6&#93; &gt; 5 && &#91;lindex $m2 6&#93; &lt; 100}&#93; \
          &#93; $m1 $m2; # interesting only in error case.<br />
      ---- Result was:
      {1 <span style="color:firebrick">0</span> 1 <span style="color:firebrick">0</span> 1 <span style="color:firebrick">0</span> 1 1 1} {<span style="color:firebrick">108.017</span> µs/# <span style="color:firebrick">463</span> # <span style="color:firebrick">9257.8</span> #/sec 50.012 net-ms} {1093.13 µs/# 46 # 914.80 #/sec 50.284 net-ms}
      ---- Result should have been (glob matching):
      {1 1 1 1 1 1 1 1 1} *
      ==== cmdMZ-6.6 FAILED
      </pre>
      
    2. login: "chrstphrchvz"
    3. mimetype: "text/plain"
  4. Ticket change [12da65bc01] (rid 259444) by serhiy.storchaka on 2026-10-20 13:46:54:

    1. icomment:
      The thresholds are unchanged on main, 9.0 and 8.6: cmdMZ-6.6 requires the 10 µs case to cost less than 100 µs per call and to run more than 500 times at more than 10000/s, a fixed budget for the interpreter overhead.
      
      A possible fix is to compare it with the 1 ms case instead (ideally 100 times faster; 5 times leaves room for slow systems):
      <verbatim>
      -	[expr {[lindex $m1 0] < 100}] \
      +	[expr {[lindex $m1 0] * 5 < [lindex $m2 0]}] \
      -	[expr {[lindex $m1 2] > 500}] \
      +	[expr {[lindex $m1 2] > [lindex $m2 2] * 5}] \
      -	[expr {[lindex $m1 4] > 10000}] \
      +	[expr {[lindex $m1 4] > [lindex $m2 4] * 5}] \
      </verbatim>
      I could not reproduce the failure (my machine is too fast, also under valgrind), but your numbers pass these checks (108 vs 1093 µs/#, 463 vs 46 #, 9257 vs 914 #/sec).
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"