Tcl/Tk Benchmark Suite And Tools
Artifact Content
Not logged in

Artifact 02cb8f4f5c1534a72c7ff63b463739d367281bef:

proc trace-bogus {name1 name2 op} {
    # just check existence
    upvar $name1 var
    info exists var

proc trace-var {def} {
    global a
    # 2 reps of write, read, unset
    set a $def
    set b $a
    unset a
    set a $def
    set b $a
    unset a

bench -desc "TRACE no trace set" -body {trace-var blah}

trace variable a r trace-bogus
bench -desc "TRACE read" -body {trace-var blah}
trace vdelete a r trace-bogus

trace variable a w trace-bogus
bench -desc "TRACE write" -body {trace-var blah}
trace vdelete a w trace-bogus

trace variable a u trace-bogus
bench -desc "TRACE unset" -body {trace-var blah}
trace vdelete a u trace-bogus

trace variable a rwu trace-bogus
bench -desc "TRACE all set (rwu)" -body {trace-var blah}
trace vdelete a rwu trace-bogus