Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f855a404c6c16412a79d2923ec882347342c2907
Ticket: 1692378fffffffffffffffffffffffffffffffff
TIP 280: performance impact
User & Date: msofer on 2008-07-23 21:33:17
Changes

  1. assignee changed to: "andreas_kupries"
  2. foundin changed to: "obsolete: 8.6a1"
  3. icomment:
    Logged In: YES 
    user_id=148712
    Originator: NO
    
    Two things that we can do to reduce the speed impact of Tip #280. Ticket 
    now marked as HEAD, but these may be backportable too.
    
    ----
    (1) Compute things lazily!
    
    Looking specifically at the canon-list path in Tcl_EvalObjv, we are now
    getting and searching the string rep of every element in the list. This
    work is generally wasted, it is only needed when and if a stack trace is
    generated. It may even be very costly, if one of the elements turns out to
    be a big list.
    
    So, at least for TCL_LOCATION_EVAL_LIST, we could just store a ref to
    objPtr (without a refCount, it is guaranteed to be alive until the command
    returns, ie until after a stack trace entry was either generated or
    not). If and when a stack trace has to be generated, the search of the
    elements' string rep can be performed.
    
    Note that
    (a) this may just show how I did not get TIP #280; if true, sorry
    (b) similar stuff can possibly be done for the other paths, but the payoff
    may be smaller: all other eval paths (compile, interp) have a string rep
    available or generate one before running anyway
    
    ----
    (2) Only attempt to manage/index/whatever Tcl_Objs that can come from
    source, avoid dealing with dynamically generated Tcl_Objs if
    possible. Currently a Tcl_Obj that either
       a) have no string rep
       b) have a List intrep and the canonicalFlag is set
    are guaranteed to be dynamically generated; TIP 280 code should be as
    gentle as possible with them
    
    
    
  4. login: "msofer"
  5. mimetype: "text/plain"
  6. priority changed to: "8"
  7. username: "msofer"