Skip to content
Tcl Source Code History Of Ticket 1202178
Login

History Of Ticket 1202178

Artifacts Associated With Ticket 1202178

  1. Ticket change [e13bca3189] (rid 87412) by das on 2005-05-15 02:43:34:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      When [time]ing a script of short duration for many counts, a lot of 
      measured precision is lost because [time] only returns an integer 
      number of microseconds.
      
      The attached very simple patch changes [time] to return a list with 
      a string rep identical to the current result string, except that the 
      returned time is a DoubleObj for count>1 (and an IntObj for 
      count==1)
      
      For things like tclbench that do [lindex 0] on the return value of 
      [time] this transparently avoids string conversion of the 
      microseconds value...
      
      I'm not sure if this change would require a TIP? it does change 
      the public API of [time] but in a way that seems innocous...
      
    4. foundin initialized to: "obsolete: 8.5a3"
    5. priority initialized to: "6"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "das"
    9. subsystem initialized to: "18. Commands M-Z"
    10. title initialized to: "Change [time] to return a float for count>1"
    11. type initialized to: "Bug"
  2. Add attachment "float-time.diff" [43916c7f31] (rid 116579) by das on 2005-05-15 09:43:35.

  3. Ticket change [f55ebaff3a] (rid 130094) by das on 2005-05-15 09:43:35:

    1. icomment:
      
      
      File Added - 134511: float-time.diff
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  4. Ticket change [57dc802ee8] (rid 117703) by dgp on 2005-05-16 09:34:22:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      That sounds suspiciously like using
      the Tcl_ObjType to embody a value
      with meaning beyond its string rep.
      We're working on getting away from
      that in the few regrettable places
      where it's been done.  I think it's a
      mistake to make new abuse of
      ObjType's like that.
      
      One internals change kbk and
      I are considering is to set a
      Tcl_ObjType to "double" only
      if its string rep is not one that
      "LooksLikeInt".  The intent is
      to simplify lots of places that
      are now forced to check whether
      a "double" Tcl_Obj is "pure"
      before making use of the cached
      double.  Sounds like your trick
      would conflict with that.
      
      On the other hand, I don't think I
      have any objection to a proposal
      to change [time] to return a
      double instead of an int.  Rather
      than sneak around the issue, can
      we just embrace the change?
      
      
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [7507db8366] (rid 105324) by dkf on 2005-05-16 15:01:42:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      [time] returns a string, not a list or an int. It just
      happens to be easy to use [lindex] and [expr] to work with
      the output.
      
      The primary consumer of [time] output as numeric data is
      probably tclbench; any change should be checked against
      what's going on there before committing.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [5ba2867ed4] (rid 118364) by das on 2005-05-19 19:47:59:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      Donal, I'm not sure I understand your objection.
      For count==1, my point was that the string rep of the list that the 
      patched [time] returns is exactly the same as the stringObj currently 
      returned (constructed via sprintf).
      As long as nobody checks the Tcl_ObjType of the return value (which 
      they shouldn't), there is no way to distingush between this list and the 
      currently returned string, AFAICT
      
      I have certainly tested tclbench against this, the patch was indeed 
      primarily motivated by the desire to get more stable results from tclbench 
      for tests with small [time] results. Everything works unchanged except 
      that all timing results are now floats
      
      Don, the motivation of using an IntObj for the count==1 case was to 
      preserve the current return string format exactly when it is not necessary 
      to change it (since the measured time can never be a float for 
      count==1). I am certainly happy to always make it a float, this idea may 
      indeed be trying to be to smart for its own good...
      
      OTOH, I don't understand why you say the patch returns information 
      embodied in the Tcl_ObjType, everything would work just the same if I 
      returned just the string rep of the list I construct as a StrinObj... (except 
      that there could be truncation due to $tcl_precision)
      
      In any case, I'd even be ok to retain the current sprintf way of 
      constructing the result as long as we switch the %f.0 in the format string 
      to something with more decimals.
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  7. Ticket change [b91df2c974] (rid 129077) by dkf on 2005-05-19 20:07:29:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      I'm just trying to think of things that might possibly go
      wrong before rolling such a change into production and
      getting howls from people whose code it breaks. Trying to
      spot problems before they happen, as opposed to trying to
      make your life hard. :^)
      
      Of course, one way round your original problem is to time
      your code on a slower computer... ;^)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [740c3c98ed] (rid 105134) by dgp on 2005-05-19 22:49:45:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      my objection was based on a misunderstanding.
      The patch is fine with me.
       
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [ab0084e559] (rid 101019) by das on 2005-05-24 03:31:28:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      committed to HEAD
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  10. Ticket change [2291e44cf1] (rid 130770) by das on 2005-05-24 11:24:42:

    1. closedate changed to: "2005-05-24T04:24:42"
    2. closer changed to: "das"
    3. icomment:
      Logged In: YES 
      user_id=90580
      
      committed to core-8-4-branch
      
      
    4. login: "das"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "das"
  11. Ticket change [64d10b18e8] (rid 92840) by vincentdarley on 2005-05-26 00:05:28:

    1. assignee changed to: "das"
    2. icomment:
      Logged In: YES 
      user_id=32170
      
      This change breaks compilation with symbols on Windows:
      
      >nmake -f makefile.vc OPTS=symbols
      ...
      tclCmdMZ.c
      ..\generic\tclCmdMZ.c(2924) : error C2220: warning treated
      as error - no object
      file generated
      ..\generic\tclCmdMZ.c(2924) : warning C4244: 'function' :
      conversion from 'double ' to 'int ', possible loss of data
      NMAKE : fatal error U1077: 'cl' : return code '0x2'
      Stop.
      
      I think a cast is needed in there...
      
      
      
    3. login: "vincentdarley"
    4. mimetype: "text/plain"
    5. status changed to: "Open"
    6. username: "vincentdarley"
  12. Ticket change [d6a6a71709] (rid 123842) by hobbs on 2005-05-26 02:27:42:

    1. closedate changed to: "2005-05-25T19:27:42"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      Fixed the cast in 8.4 and head
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "hobbs"