Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cdb0ad937f057b202bba49c7c04f0690260ddb28
Ticket: 2868499fffffffffffffffffffffffffffffffff
TIP #348: Substituted errorStack
User & Date: ferrieux on 2009-10-20 23:17:22
Changes

  1. icomment:
    Attaching a new patch, errorstack2.patch, fulfilling Joe's request of [info errostack ?interp?] and [dict get $d -errostack].
    I left the ::tcl::useErrorStack control variable for perf measurements:
        0 --> pristine HEAD
        1 --> just [info errorstack]
        2 ---> adds options dict entry -errorstack
    
    Note the implementation still uses ckalloc-based Tcl_NewListObj for argslist, pending proof that optimization is needed.
    Here are the figures:
    
    Case: Ten-fold catch ladder  use=0 ->    74.7924 microseconds per iteration
    Case: Ten-fold catch ladder  use=1 ->    76.7888 microseconds per iteration
    Case: Ten-fold catch ladder  use=2 ->    77.1977 microseconds per iteration
    Case: Single Catch with opt dict  use=0 ->    19.2613 microseconds per iteration
    Case: Single Catch with opt dict  use=1 ->    19.7608 microseconds per iteration
    Case: Single Catch with opt dict  use=2 ->    20.2815 microseconds per iteration
    
    with code:
    
    for {set i 1} {$i<10} {incr i} {
    proc f$i x "f[expr {$i+1}] \$x"
    }
    proc f10 x {error F10:$x}
    
    proc boo {} {error BOO}
    
    proc catchloop {} {
    for {set i 0} {$i<100000} {incr i} {
    if {[catch boo m d]} continue
    }
    }
    
    foreach {mm ss} {
    "Ten-fold catch ladder" {catch {f1 12}}
    "Single Catch with opt dict" {catch boo m d}
    } {
    
    foreach v {0 1 2} {
    set ::tcl::useErrorStack $v
    puts "Case: $mm  use=$v ->    [time $ss 10000]"
    }
    }
    
           
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"