Skip to content
Tcl Source Code History Of Ticket 466037ffff
Login

History Of Ticket 466037ffff

Artifacts Associated With Ticket 466037ffff

  1. Ticket change [c12620ff6b] (rid 111277) by msofer on 2001-09-28 13:35:33:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Let the compiler recognise the idioms
        [lindex $list 0] ;# get the head of $list
      and
        [lrange $list 1 end] ;# get the tail of $list
      and compile-in optimised code for them.
      
      The idea is to make the list operations usual in
      functional programming very efficient. This follows a
      discussion started in c.l.t. by Acacio Cruz - the
      thread does not yet show up in google, I will add the
      reference as soon as available.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "msofer"
    9. subsystem initialized to: "47. Bytecode Compiler"
    10. title initialized to: "Optimise getting the head/tail of a list"
    11. type initialized to: "RFE"
  2. Ticket change [d7ec75f743] (rid 107352) by msofer on 2001-09-28 21:51:27:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The clt thread is at
      http://groups.google.com/groups?hl=en&threadm=3BB3F8D8.51932A75%40eur.autodesk.com&prev=/groups%3Foi%3Ddjq%26as_ugroup%3Dcomp.lang.tcl
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [91366f3d7f] (rid 120587) by hobbs on 2001-09-29 01:51:47:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Note that lindex is already about as optimized as can be in 
      the byte-code compiler.  lrange could be worked on.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  4. Ticket change [2110133ec6] (rid 130521) by mdejong on 2001-09-29 01:57:17:

    1. icomment:
      Logged In: YES 
      user_id=90858
      
      Is supporting lisp like recursion really that
      important? It seems like the foreach command
      is far better than list like recursion any
      day of the week.
      
      
      
    2. login: "mdejong"
    3. mimetype: "text/plain"
    4. username: "mdejong"
  5. Ticket change [8877e28507] (rid 131872) by msofer on 2001-09-29 02:01:54:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The idea was to recognize at compile time that the index to
      [lindex] is an integer, so that the call to
      TclGetIntForIndex can be avoided at runtime. In this sense,
      head can be improved - I do not really know how much of a
      difference it will make.
      
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  6. Ticket change [8e533293e9] (rid 120097) by andreas_kupries on 2001-09-29 05:27:31:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      Note that optimizing 'end', 'end-1' is harder than 
      for '0', '1', etc. The index cannot be transmitted to the 
      lindex bytecode as a simple number (behaviour for negative 
      numbers is defined, return the empty string). This requires 
      an additional 'index' objtype which can represent static 
      indices from the end.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  7. Ticket change [1b5a67c1da] (rid 123133) by hobbs on 2001-09-29 05:45:59:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Sure it can - just pass a negative number.  If you are 
      handling immediates, you get to define your own syntax, and 
      allow negative numbers.  This would have been easier all 
      along (instead of the end-x), but people perceived that to 
      be a compatability problem.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  8. Ticket change [03dbfdc4de] (rid 119899) by andreas_kupries on 2001-09-29 06:40:37:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      So [lindex $foo -1] just pushes an empty object,
      [lindex $foo end-1] passes index '-1' to the bytecode
      and [lindex $foo $idx] compiles to something which goes 
      through TclGetForIndex ? Could work. 
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  9. Ticket change [d27780674c] (rid 113532) by msofer on 2001-10-01 19:13:01:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      A  small change to Andreas' description, to allow the
      representation of "end" ('-0'?): let '-1' stand for 'end',
      so that the previous description becomes:
      
      So [lindex $foo -1] just pushes an empty object, [lindex
      $foo end-1] passes index '-2' to the bytecode and [lindex
      $foo $idx] compiles to something which goes through
      TclGetForIndex ? Could work.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  10. Ticket change [f550fecb92] (rid 130084) by kennykb on 2001-10-03 22:28:56:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=99768
      
      The changes I'm working on for TIP #22 already have a Tcl_ObjType for 'end-' indices.  Note that 
      Tcl_GetIntForIndex should be extremely fast if the index is constant because the first couple of lines of 
      code check for 'int' and 'index' objtypes, and the string rep is examined only if both those checks fail.
      
      We may at some point want to revisit what happens for [lindex $list end-$i], but that's farther out.
      
      For what it's worth, what's compiled for [lindex $list $i], with $list and $i both local, is
      
          INST_LOAD_SCALAR1 <var # for list>
          INST_LOAD_SCALAR1 <var # for i>
          INST_LIST_INDEX
      
      For [lindex $list 0], it'll be
      
          INST_LOAD_SCALAR1 <var # for list>
          INST_PUSH1 <literal # for 0>
          INST_LIST_LINDEX
      
      INST_LIST_LINDEX does indeed call TclGetIntForIndex, but that's been changed to begin with looking for 
      tclIntType and tclEndOffsetType and not do any parsing if the object is already a known type.
      
      Let's see how that does on the benchmarks before we try to squeeze any more out of it.
      
      
    3. login: "kennykb"
    4. mimetype: "text/plain"
    5. username: "kennykb"
  11. Ticket change [7475c51a20] (rid 105208) by kennykb on 2001-11-21 00:34:45:

    1. closedate changed to: "2001-11-20T17:34:45"
    2. closer changed to: "kennykb"
    3. icomment:
      Logged In: YES 
      user_id=99768
      
      Just spoke with the originator, and he says that "he requested feature has been provided."
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "kennykb"