Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b21e1e67d36ffedb12229ce23d2c01e6a70241b8
Ticket: 1692378fffffffffffffffffffffffffffffffff
TIP 280: performance impact
User & Date: nemethi on 2007-04-01 15:47:16
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Consider the following simple script:
    
    proc p {arg} {
        switch $arg {
            a {return A}
            b {return B}
            c {return C}
            d {return D}
            e {return E}
            f {return F}
            g {return G}
            h {return H}
            i {return I}
            j {return J}
            k {return K}
            l {return L}
            m {return M}
            n {return N}
            o {return O}
            p {return P}
            q {return Q}
            r {return R}
            s {return S}
            t {return T}
        }
    }
    
    puts [time {p "a"} 100000]      ;# matching case
    puts [time {p "x"} 100000]      ;# non-matching case
    
    Here is the output when running Tcl 8.4.13 on my rather slow Linux box (SuSE Linux 10.0):
    
    4.89964 microseconds per iteration
    5.37998 microseconds per iteration
    
    And here is the output produced by Tcl 8.4.14:
    
    15.80254 microseconds per iteration
    5.47919 microseconds per iteration
    
    The last Tcl 8.5.a6 from the CVS performs even more poorly:
    
    18.48226 microseconds per iteration
    5.43836 microseconds per iteration
    
    The results above expose a drastical performance regression in the matching case!
    
  4. foundin changed to: "obsolete: 8.4.14"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "nemethi"
  10. subsystem changed to: "18. Commands M-Z"
  11. title changed to: "Drastical switch command performance regression"
  12. type changed to: "Bug"