Skip to content
Tcl Source Code History Of Ticket 3408408fff
Login

History Of Ticket 3408408fff

Artifacts Associated With Ticket 3408408fff

  1. Ticket change [432cd065c7] (rid 116504) by ferrieux on 2011-09-13 06:22:11:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      To save memory by sharing oft-used values, a natural technique would be
      
       lappend storage [expr {$computed_bit?1:0}]
      
      Unfortunately, the 1 and 0 values coming out of the [expr] are *not* extra references to the hugely shared literals, but fresh copies.
      A mysterious workaround guessed out of the blue by Colin is:
      
       lappend storage [expr {$computed_bit==1}]
      
      Funnily, the ternary operator *can* respect sharing with more complex values:
      
       set list1 [list yes yes yes]
       set list2 [list no no no]
       lappend storage [expr {$computed_bit?$LIST1:$LIST2}]
      
      All three behaviors are suprising...
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "ferrieux"
    10. subsystem initialized to: "48. Number Handling"
    11. title initialized to: "Erratic sharing/duplication of values in [expr]"
    12. type initialized to: "Bug"
  2. Ticket change [773e94c107] (rid 89746) by ferrieux on 2011-09-13 13:30:18:

    1. icomment:
      15:19        dgp        ferrieux, based on a quck look I think your sharing goals are getting thwarted by the TRY_CVT_TO_NUMERIC shenanigans that take place on the way out of an [expr].
      15:20        dgp        Another contributor may be whether your context has [expr] compiled early, or compiled only at run time.
      
      16:11        dgp        ferrieux, a possible way forward on the expr literal sharing issue...
      16:12        dgp        At the point in CompileExprTree() where the INST_TRY_CVT_TO_NUMERIC opcode is pushed...
      16:13        dgp        ...because we've determined there's a possible need to convert a non-canonical number to its canonical form...
      16:15        dgp        if there's some way to make the conversion right there at compile time to canonical form, register *that* as a literal and sieze the sharing advantage then avoid pushing the opcode...
      16:15        dgp        ...well that's the concept.  I'd have to review how much we know at that point.
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [2710ce6ece] (rid 88451) by dgp on 2011-09-15 23:28:06:

    1. icomment:
      
      Partial improvement toward increased sharing
      committed to trunk.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [0e3133c441] (rid 94567) by dgp on 2011-09-16 02:06:53:

    1. icomment:
      
      Unfortunately tackling the specific case in the
      ticket is at least difficult.  It's long been the (unwise?)
      design of [expr] to not embrace "everything is a string"
      but impose on [expr] the burden of producing only
      'normalized' string reps of numbers:
      
      % expr 7.5000
      7.5
      % expr 0x1
      1
      
      It's precisely when a literal value 
      is bubbling up from the leaf of an
      expression tree to become the result
      of the expression that we do not know
      whether or not it's already in normalized
      form.  The TRY_CVT_TO_NUMERIC 
      instruction is pushed to enforce the guarantee
      and the way it operates is to produce a new
      unshared value.
      
      Absent a revolution where we at long last let
      [expr] embrace the EIAS philosophy, I don't 
      see any quick and simple path to improve this.
      And for now, I don't have the cycles to spare
      for something more ambitious.  Sorry.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. resolution changed to: "Postponed"
    5. username: "dgp"