Skip to content
Tcl Source Code History Of Ticket 1890831
Login

History Of Ticket 1890831

Artifacts Associated With Ticket 1890831

  1. Ticket change [e6c433289d] (rid 104346) by ferrieux on 2008-02-10 23:30:16:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The attached patch against 8.5.1 is a cleanup of the [lrange] implementation, including:
      
       - use of T_LOL to stick to the style of other list ops, instead of a complex and unique anti-shimmering share-intrep mechanism dedicated to a rare and already fast case [lrange $x $x $x].
      
       - flattening of if-return's to stick to the style of other list ops, improving readability.
      
       - detection of unshared case to operate in-place, by calling twice Tcl_ListObjReplace (in correct order).
      
      The first two points are just a matter of style, but allow for the third, which is a pretty significant optimization. Measurements on a 100-million list [lrepeat 100000000 1]:
      
       [lrange ... 1 end] in-place gives a 3x speedup
       [lrange ... 0 end-1] in-place gives a 24000x speedup
      
      -Alex
      
      
      % set l [lrepeat 100000000 1];llength $l
      100000000
      % time {set l [lrange $l 1 end];llength $l}
      814663 microseconds per iteration
      % proc K { x y } {set x}
      % time {set l [lrange [K $l [unset l]] 1 end];llength $l}
      272517 microseconds per iteration
      
      % set l [lrepeat 100000000 1];llength $l
      100000000
      % time {set l [lrange $l 0 end-1];llength $l}
      815985 microseconds per iteration
      % set l [lrepeat 100000000 1];llength $l
      100000000
      % time {set l [lrange [K $l [unset l]] 0 end-1];llength $l}
      34 microseconds per iteration
      
    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: "17. Commands I-L"
    11. title initialized to: "Lrange cleanup and in-place optimization"
    12. type initialized to: "Patch"
  2. Add attachment "lrange_cleanup.patch" [c36bca0499] (rid 111657) by ferrieux on 2008-02-11 06:30:17.

  3. Ticket change [c16c9bcf04] (rid 111317) by ferrieux on 2008-02-11 06:30:18:

    1. icomment:
      
      
      File Added - 265796: lrange_cleanup.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [128b18629d] (rid 124050) by dgp on 2008-02-12 00:40:23:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      The patch intrudes a bit into the
      internal rep of the "list" Tcl_ObjType
      with the cast to (List *).  I'd like a
      slight refactoring better where that
      code got moved into tclListObj.c as
      some internal routine called by
      Tcl_LrangeObjCmd().  Just a preference
      to put as much of the code needing to know
      about "list" intReps over in tclListObj.c
      as we can.  Not a requirement, but something
      nice to do.
      
      I know we're not "pure" by that measure
      currently.  It's about preference and
      direction.
      
      Might be interesting to try the K-free K
      as well:
      
      lrange $l[unset l] 0 end-1
      
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [c39f761fbb] (rid 111695) by ferrieux on 2008-02-12 01:51:11:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: YES
      
      About the needed refactoring to avoid (List *), please notice that I stole it from Tcl_LreverseObjCmd, right in the same file, and that half a dozen other places in tclCmdIL.c directly reach into Lists. So, I suggest either to leave it that way, or to clean everything up at the same time (slight preference for the former). Your choice ?
      
      Also, thanks for the K-free K trick. I was really amazed to see $l"" not shimmer to pure-string; has this optimization of concat existed for long ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [cfb936e269] (rid 113037) by dgp on 2008-02-12 03:05:22:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      dkf can make the call whether he wants
      any changes before committing.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [583f26f1e5] (rid 117769) by ferrieux on 2008-04-29 20:30:49:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=496139
      Originator: YES
      
      Miguel, again throwing this one to you in the hope of reducing the pressure on Donal's shoulders...
      Tell me if you prefer otherwise.
      
      
    3. login: "ferrieux"
    4. mimetype: "text/plain"
    5. username: "ferrieux"
  8. Ticket change [4edea24fa4] (rid 125721) by msofer on 2008-06-28 22:47:58:

    1. assignee changed to: "ferrieux"
    2. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      This looks OK for commit to HEAD; Alex, please do. 
      
      It would be nice to insure that the testsuite covers any possible gotcha (although I cannot thing of any right now). 
      
      It'd be also nice to check if tclbench will expose the improvement, and to write a small bench to include there if not.
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. username: "msofer"
  9. Ticket change [a0644802cd] (rid 96805) by ferrieux on 2008-06-30 06:25:24:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: YES
      
      Committed to HEAD.
      Will be preparing test and tclbench cases from now on.
      Leaving this open as a reminder.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  10. Ticket change [e8fe637a4c] (rid 104733) by ferrieux on 2008-07-24 06:23:44:

    1. closedate changed to: "2008-07-23T23:23:44"
    2. closer changed to: "ferrieux"
    3. icomment:
      Logged In: YES 
      user_id=496139
      Originator: YES
      
      Test suite updated with a relative speed test.
      
      
    4. login: "ferrieux"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "ferrieux"