Tcl/Tk Benchmark Suite And Tools
Artifact Content
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

Artifact 9157253edc9dd714ed7be8e65ee294de9683c259:


#
# RCS: @(#) $Id: string.bench,v 1.27 2010/09/25 01:51:32 hobbs Exp $
#

proc str-cmp-null {a} {
    if {[string compare $a ""]} { set i 0 } else { set i 1 }
    if {[string compare $a ""]} { set i 0 } else { set i 1 }
    if {[string compare $a ""]} { set i 0 } else { set i 1 }
    if {[string compare $a ""]} { set i 0 } else { set i 1 }
}
proc str-cmp {a b} {
    string compare $a $b
    string compare $a $b
    string compare $a $b
    string compare $a $b
}

if { [catch {string equal "" ""}] } {
    proc str-equal-null {a} {
	if {[string compare $a ""]} { set i 0 } else { set i 1 }
	if {[string compare $a ""]} { set i 0 } else { set i 1 }
	if {[string compare $a ""]} { set i 0 } else { set i 1 }
	if {[string compare $a ""]} { set i 0 } else { set i 1 }
    }
    proc str-eq-null {a} {
	if {$a == ""} { set i 0 } else { set i 1 }
	if {$a == ""} { set i 0 } else { set i 1 }
	if {$a == ""} { set i 0 } else { set i 1 }
	if {$a == ""} { set i 0 } else { set i 1 }
    }
} else {
    proc str-equal-null {a} {
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
    }
    proc str-eq-null {a} {
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
	if {[string equal $a ""]} { set i 1 } else { set i 0 }
    }
}

proc str-==-null {a} {
    if {$a == ""} { set i 1 } else { set i 0 }
    if {$a == ""} { set i 1 } else { set i 0 }
    if {$a == ""} { set i 1 } else { set i 0 }
    if {$a == ""} { set i 1 } else { set i 0 }
}

if { [catch {expr {"" eq ""}} nope] } {
    if { [catch {string equal "" ""}] } {
	proc str-eq {a b} {
	    if {![string compare $a $b]} { set i 0 } else { set i 1 }
	    if {![string compare $a $b]} { set i 0 } else { set i 1 }
	    if {![string compare $a $b]} { set i 0 } else { set i 1 }
	    if {![string compare $a $b]} { set i 0 } else { set i 1 }
	}
	proc str-ne {a b} {
	    if {[string compare $a $b]} { set i 0 } else { set i 1 }
	    if {[string compare $a $b]} { set i 0 } else { set i 1 }
	    if {[string compare $a $b]} { set i 0 } else { set i 1 }
	    if {[string compare $a $b]} { set i 0 } else { set i 1 }
	}
    } else {
	proc str-eq {a b} {
	    if {[string equal $a $b]} { set i 0 } else { set i 1 }
	    if {[string equal $a $b]} { set i 0 } else { set i 1 }
	    if {[string equal $a $b]} { set i 0 } else { set i 1 }
	    if {[string equal $a $b]} { set i 0 } else { set i 1 }
	}
	proc str-ne {a b} {
	    if {![string equal $a $b]} { set i 0 } else { set i 1 }
	    if {![string equal $a $b]} { set i 0 } else { set i 1 }
	    if {![string equal $a $b]} { set i 0 } else { set i 1 }
	    if {![string equal $a $b]} { set i 0 } else { set i 1 }
	}
    }
} else {
    proc str-eq {a b} {
	if {$a eq $b} { set i 0 } else { set i 1 }
	if {$a eq $b} { set i 0 } else { set i 1 }
	if {$a eq $b} { set i 0 } else { set i 1 }
	if {$a eq $b} { set i 0 } else { set i 1 }
    }
    proc str-ne {a b} {
	if {$a ne $b} { set i 0 } else { set i 1 }
	if {$a ne $b} { set i 0 } else { set i 1 }
	if {$a ne $b} { set i 0 } else { set i 1 }
	if {$a ne $b} { set i 0 } else { set i 1 }
    }
    # redef'n from above
    proc str-eq-null {a} {
	if { $a eq "" } { set i 1 } else { set i 0 }
	if { $a eq "" } { set i 1 } else { set i 0 }
	if { $a eq "" } { set i 1 } else { set i 0 }
	if { $a eq "" } { set i 1 } else { set i 0 }
    }
}

proc str-len {a} {
    string length $a
}

proc str-len-static {bogusVar} {
    string length {abcdefghijklmnopqrstuvwxyz0123456789}
    string length {abcdefghijklmnopqrstuvwxyz01234567890123456789}
    string length {abcdefghijklmnopqrstuvwxyz012345678901234567890123456789}
}

proc str-index {a i} {
    string index $a $i
}

proc str-first {a s} {
    string first $s $a
}

proc str-last {a s} {
    string last $s $a
}

proc str-match {a p} {
    string match $p $a
}

proc str-match-exact {a} {
    string match exactString $a
}

if {[info tclversion] < 8.2} {
    proc str-match-nocase {a p} {
	string match [string tolower $p] [string tolower $a]
    }
    proc str-match-nocase-exact {a} {
	string match exactstring [string tolower $a]
    }
} else {
    proc str-match-nocase {a p} {
	string match -nocase $p $a
    }
    proc str-match-nocase-exact {a} {
	string match -nocase exactString $a
    }
}

proc str-range {a s e} {
    string range $a $s $e
}

proc str-grow-len {i} {
    set str ""
    while {$i} {
	append str a
	incr i -1
    }
}
proc str-grow-len-uc {i} {
    set str ""
    while {$i} {
	append str \370
	incr i -1
    }
}

if { [catch {string replace "abc" 0 0}] } {
    proc str-replace {a s e {r ""}} {
	set res [string range $a 0 $s]$r[string range $a $e end]
    }
} else {
    proc str-replace {a s e {r ""}} {
	string replace $a $s $e $r
    }
}

if { [catch {string repeat "abc" 10}] } {
    proc str-repeat {str num} {
	set val {}
	for {set i 0} {$i < $num} {incr i} {
	    append val $str
	}
	set val
    }
} else {
    proc str-repeat {str num} {
	string repeat $str $num
    }
}

proc str-append {s a {count 1}} {
    append out $s
    for {set i 0} {$i < $count} {incr i} {
	append out $a
    }
}

proc str-append-2 {s small large count} {
    append out $s
    for {set i 0} {$i < $count} {incr i} {
	append out $small $large $small
    }
}

proc rev-core {string} {
    return [string reverse $string]
}
if {[info tclversion] < 8.5} {
    proc rev-core {string} { return -code 666 "8.5+" }
}
proc rev-set {string} {
    set len [string length $string]
    set out {}
    while {$len} {
	set out $out[string index $string [incr len -1]]
    }
    return $out
}
proc rev-append {string} {
    set len [string length $string]
    set out {}
    while {$len} {
	append out [string index $string [incr len -1]]
    }
    return $out
}
proc rev-recursive {string} {
    if {[string length $string]} {
	return [rev-recursive \
		[string range $string 1 end]][string index $string 0]
    }
}
if {[info tclversion] < 8.0} {
    # large strings hit the infinite loop boundary (recursion limit) in 7.x
    proc rev-recursive2 {string} {
	if {[string length $string]} {
	    return [rev-recursive2 \
		    [string range $string 1 end]][string index $string 0]
	}
    }
    proc rev-recursive {string} {
	if {[string length $string] > 200} {
	    return -code 666 "8.0+"
	}
	rev-recursive2 $string
    }
}

# String operations
# It is important to have 2 of each type, to avoid optimizations
# in the core made for comparing the same exact obj.
#

proc init {} {
    global longString longString2 ustring ustring2
    for {set i 0} {$i < 100} {incr i} {
	append longString "abcdefghijklmnopqrstuvwxyz01234567890123"
    }
    append longString 0987654321
    for {set i 0} {$i < 100} {incr i} {
	append longString2 "abcdefghijklmnopqrstuvwxyz01234567890123"
    }
    append longString2 0987654321
    for {set i 0} {$i < 100} {incr i} {
	append ustring "abcdefghijk\353\370\371\372pqrs\373uvwxyz0123456789012\374"
    }
    #set ustring2 "$ustring \369a"
    for {set i 0} {$i < 100} {incr i} {
	append ustring2 "abcdefghijk\353\370\371\372pqrs\373uvwxyz0123456789012\374"
    }
    if {[info tclversion] >= 8.0} {
	global randString
	expr {srand(12345)}
	for {set i 0} {$i < 10000} {incr i} {
	    append randString [format %c [expr {int(rand()*255)}]]
	}
    }
}
init

# String comparisons
#
set str1 "This is a string"
set str2 "This is also a string"

bench -desc "STR string compare" \
	-body {str-cmp $str1 $str2}
bench -desc "STR string compare long" \
	-body {str-cmp $longString $longString2}
bench -desc "STR string compare long (same obj)" \
	-body {str-cmp $longString $longString}
bench -desc "STR string compare mixed long" \
	-body {str-cmp $longString "$longString\369"}
bench -desc "STR string compare uni long" \
	-body {str-cmp $ustring $ustring2}
bench -desc "STR string compare \"\"" \
	-body {str-cmp-null 12345}
bench -desc "STR string equal long (same obj)" \
	-body {str-eq $longString $longString}
bench -desc "STR string equal long (== len)" \
	-body {str-eq $longString $longString2}
bench -desc "STR string equal long (!= len)" \
	-body {str-eq $longString "$longString2 a"}
set mixed $longString
append mixed \369
bench -desc "STR string equal mixed long" \
	-body {str-eq $longString $mixed}
bench -desc "STR string equal uni long" \
	-body {str-eq $ustring $ustring2}
bench -desc "STR string equal \"\"" \
	-body {str-equal-null 12345}
bench -desc "STR str \$a equal \"\"" \
	-body {str-eq-null 12345}
bench -desc "STR str num == \"\"" \
	-body {str-==-null 12345}
bench -desc "STR str \$a eq \$b" \
	-body {str-eq $str1 $str2}
bench -desc "STR str \$a ne \$b" \
	-body {str-ne $str1 $str2}
bench -desc "STR str \$a eq \$b (same obj)" \
	-body {str-eq $str1 $str1}
bench -desc "STR str \$a ne \$b (same obj)" \
	-body {str-ne $str1 $str1}

if {[info tclversion] >= 8.2} {
    # binary obj data comparison checks
    bench -desc "STR strcmp bin short eq" \
	-body {str-cmp [binary format @100a 0] [binary format @100a 0]}
    bench -desc "STR streq bin short eq" \
	-body {str-eq  [binary format @100a 0] [binary format @100a 0]}
    bench -desc "STR strcmp bin long eq" \
	-body {str-cmp [binary format @10000a 0] [binary format @10000a 0]}
    bench -desc "STR streq bin long eq" \
	-body {str-eq  [binary format @10000a 0] [binary format @10000a 0]}
    bench -desc "STR strcmp bin long neq" \
	-body {str-cmp [binary format @10000aa 0 2] \
		   [binary format @10000aa 0 1]}
    bench -desc "STR streq bin long neq" \
	-body {str-eq  [binary format @10000aa 0 3] \
		   [binary format @10000aa 0 4]}

    bench -desc "STR strcmp bin long neqS" \
	-body {str-cmp [binary format @10000aa 0 2] \
		   [binary format a@10000a 5 1]}
    bench -desc "STR streq bin long neqS" \
	-body {str-eq  [binary format @10000aa 0 3] \
		   [binary format a@10000a 5 4]}
}

bench -desc "STR length (==[string length $longString])" \
	-body {str-len $longString}
bench -desc "STR length static str" \
	-body {str-len-static dummy}

set len 1000
bench -desc "STR length growing ($len)" -iter 100 \
	-body {str-grow-len $len}
bench -desc "STR length growing uc ($len)" -iter 100 \
	-body {str-grow-len-uc $len}

foreach len {0 100 500} {
    bench -desc "STR index $len" \
	    -body {str-index $longString $len}
}

bench -desc "STR first (success)" \
	-body {str-first $longString 901}
bench -desc "STR first (failure)" \
	-body {str-first $longString cba}
bench -desc "STR first (total failure)" \
	-body {str-first $longString ===}
bench -desc "STR first (success) utf" \
	-body {str-first $ustring "\374ab"}
bench -desc "STR first (failure) utf" \
	-body {str-first $ustring "\373cba"}
bench -desc "STR first (total failure) utf" \
	-body {str-first $ustring ===}

bench -desc "STR last (success)" \
	-body {str-last $longString 901}
bench -desc "STR last (failure)" \
	-body {str-last $longString cba}
bench -desc "STR last (total failure)" \
	-body {str-last $longString ===}

bench -desc "STR match, exact (failure)" \
	-body {str-match-exact nomatchwhatsoever} -result 0
bench -desc "STR match, exact (success)" \
	-body {str-match-exact exactString} -result 1
bench -desc "STR match, exact -nocase (success)" \
	-body {str-match-nocase-exact EXACTSTRING} -result 1
bench -desc "STR match, exact -nocase (failure)" \
	-body {str-match-nocase-exact nomatchwhatsoever} -result 0
bench -desc "STR match, simple (success)" \
	-body {str-match cba cba} -result 1
bench -desc "STR match, simple (failure)" \
	-body {str-match cba ===} -result 0
bench -desc "STR match, complex (success early)" \
	-body {str-match $longString *901*} -result 1
bench -desc "STR match, complex (success late)" \
	-body {str-match $longString *321} -result 1
bench -desc "STR match, complex (failure)" \
	-body {str-match $longString *cba*} -result 0
bench -desc "STR match, complex (total failure)" \
	-body {str-match $longString *===*} -result 0
bench -desc "STR match, recurse2 (fail)" -iter 100 \
	-body {str-match $longString *a*z*cba*} -result 0
bench -desc "STR match, recurse2 (success)" -iter 100 \
	-body {str-match $longString *a*z*987*} -result 1
bench -desc "STR match, recurse (fail backtrack)" -iter 100 \
	-body {str-match a[str-repeat b 200] *a*b*c*} -result 0
bench -desc "STR match, recurse (fail bt1)" -iter 100 \
    -body {str-match a[str-repeat b 200] {*a*[abc]*c*}} -result 0
bench -desc "STR match, recurse (fail bt2)" -iter 100 \
    -body {str-match a[str-repeat b 200] {*a*[a-z]*c*}} -result 0
bench -desc "STR match, recurse (success bt2)" -iter 100 \
    -body {str-match a[str-repeat b 200] {*a*b*[a-z]}} -result 1
bench -desc "STR match, recurse (fail ranchor)" -iter 100 \
	-body {str-match $longString *a*b*%} -result 0

bench -desc "STR range, index 100..200 of [string length $longString]" \
	-body {str-range $longString 100 200}

bench -desc "STR replace, no replacement" \
	-body {str-replace $longString 10 20}
bench -desc "STR replace, equal replacement" \
	-body {str-replace $longString 10 20 "0000000000"}
bench -desc "STR replace, longer replacement" \
	-body {str-replace $longString 10 20 "00000000000000000000"}

bench -desc "STR repeat, abcdefghij * 10" \
	-body {str-repeat "abcdefghij" 10}
bench -desc "STR repeat, abcdefghij * 100" \
	-body {str-repeat "abcdefghij" 100}
bench -desc "STR repeat, abcdefghij * 1000" \
	-body {str-repeat "abcdefghij" 1000}
bench -desc "STR repeat, [string length $longString] chars * 10" \
	-body {str-repeat $longString 10}
bench -desc "STR repeat, [string length $longString] chars * 100" \
	-body {str-repeat $longString 100}

foreach chars {10 100 400} {
    foreach {desc cmd} {
	iter/append rev-append
	iter/set    rev-set
	recursive   rev-recursive
	core        rev-core
    } {
	bench -desc "STR reverse $desc, $chars c" \
	    -pre {set string [string range $longString 1 $chars]} \
	    -body {$cmd $string}
	bench -desc "STR reverse $desc, $chars uc" \
	    -pre {set string [string range $ustring 1 $chars]} \
	    -body {$cmd $string}
    }
}

bench -desc "STR append" \
      -body {str-append $longString "01234567890123456789"}

set kilobyte	[str-repeat "0" 1024]
set base	[str-repeat "0" 1024]
bench -desc "STR append (1KB + 1KB)" \
	-body {str-append $base $kilobyte}

set base [str-repeat "0" 10240]
bench -desc "STR append (10KB + 1KB)" \
	-body {str-append $base $kilobyte}

set base [str-repeat "0" 1049600]
set iters 200
bench -desc "STR append (1MB + 2b*1000)" -iters $iters \
	-body {str-append $base "00" 1000}
bench -desc "STR append (1MB + 1KB)" -iters $iters \
	-body {str-append $base $kilobyte}
bench -desc "STR append (1MB + 1KB*20)" -iters $iters \
	-body {str-append $base $kilobyte 20}
bench -desc "STR append (1MB + 1KB*1000)" -iters $iters \
	-body {str-append $base $kilobyte 1000}
bench -desc "STR append (1MB + (1b+1K+1b)*100)" -iters $iters \
	-body {str-append-2 $base "b" $kilobyte 100}
set iters 50
bench -desc "STR append (1MB + 1MB*3)" -iters $iters \
	-body {str-append $base $base 3}
bench -desc "STR append (1MB + 1MB*5)" -iters $iters \
	-body {str-append $base $base 4}

catch {unset longString longString2 ustring ustring2}
catch {unset randString}

proc proc-locals {404040} {
    set 0000 1;  set 0001 1;  set 0002 1;  set 0003 1;  set 0004 1;  set 0005 1
    set 0006 1;  set 0007 1;  set 0008 1;  set 0009 1;  set 0010 1;  set 0011 1
    set 0012 1;  set 0013 1;  set 0014 1;  set 0015 1;  set 0016 1;  set 0017 1
    set 0018 1;  set 0019 1;  set 0020 1;  set 0021 1;  set 0022 1;  set 0023 1
    set 0024 1;  set 0025 1;  set 0026 1;  set 0027 1;  set 0028 1;  set 0029 1
    set 0030 1;  set 0031 1;  set 0032 1;  set 0033 1;  set 0034 1;  set 0035 1
    set 0036 1;  set 0037 1;  set 0038 1;  set 0039 1;  set 0040 1;  set 0041 1
    set 0042 1;  set 0043 1;  set 0044 1;  set 0045 1;  set 0046 1;  set 0047 1
    set 0048 1;  set 0049 1;  set 0050 1;  set 0051 1;  set 0052 1;  set 0053 1
    set 0054 1;  set 0055 1;  set 0056 1;  set 0057 1;  set 0058 1;  set 0059 1
    set 0060 1;  set 0061 1;  set 0062 1;  set 0063 1;  set 0064 1;  set 0065 1
    set 0066 1;  set 0067 1;  set 0068 1;  set 0069 1;  set 0070 1;  set 0071 1
    set 0072 1;  set 0073 1;  set 0074 1;  set 0075 1;  set 0076 1;  set 0077 1
    set 0078 1;  set 0079 1;  set 0080 1;  set 0081 1;  set 0082 1;  set 0083 1
    set 0084 1;  set 0085 1;  set 0086 1;  set 0087 1;  set 0088 1;  set 0089 1
    set 0090 1;  set 0091 1;  set 0092 1;  set 0093 1;  set 0094 1;  set 0095 1
    set 0096 1;  set 0097 1;  set 0098 1;  set 0099 1;  set 0100 1;  set 0101 1
    set 0102 1;  set 0103 1;  set 0104 1;  set 0105 1;  set 0106 1;  set 0107 1
    set 0108 1;  set 0109 1;  set 0110 1;  set 0111 1;  set 0112 1;  set 0113 1
    set 0114 1;  set 0115 1;  set 0116 1;  set 0117 1;  set 0118 1;  set 0119 1
    set 0120 1;  set 0121 1;  set 0122 1;  set 0123 1;  set 0124 1;  set 0125 1
    set 0126 1;  set 0127 1;  set 0128 1;  set 0129 1;  set 0130 1;  set 0131 1
    set 0132 1;  set 0133 1;  set 0134 1;  set 0135 1;  set 0136 1;  set 0137 1
    set 0138 1;  set 0139 1;  set 0140 1;  set 0141 1;  set 0142 1;  set 0143 1
    set 0144 1;  set 0145 1;  set 0146 1;  set 0147 1;  set 0148 1;  set 0149 1
    set 0150 1;  set 0151 1;  set 0152 1;  set 0153 1;  set 0154 1;  set 0155 1
    set 0156 1;  set 0157 1;  set 0158 1;  set 0159 1;  set 0160 1;  set 0161 1
    set 0162 1;  set 0163 1;  set 0164 1;  set 0165 1;  set 0166 1;  set 0167 1
    set 0168 1;  set 0169 1;  set 0170 1;  set 0171 1;  set 0172 1;  set 0173 1
    set 0174 1;  set 0175 1;  set 0176 1;  set 0177 1;  set 0178 1;  set 0179 1
    set 0180 1;  set 0181 1;  set 0182 1;  set 0183 1;  set 0184 1;  set 0185 1
    set 0186 1;  set 0187 1;  set 0188 1;  set 0189 1;  set 0190 1;  set 0191 1
    set 0192 1;  set 0193 1;  set 0194 1;  set 0195 1;  set 0196 1;  set 0197 1
    set 0198 1;  set 0199 1;  set 0200 1;  set 0201 1;  set 0202 1;  set 0203 1
    set 0204 1;  set 0205 1;  set 0206 1;  set 0207 1;  set 0208 1;  set 0209 1
    set 0210 1;  set 0211 1;  set 0212 1;  set 0213 1;  set 0214 1;  set 0215 1
    set 0216 1;  set 0217 1;  set 0218 1;  set 0219 1;  set 0220 1;  set 0221 1
    set 0222 1;  set 0223 1;  set 0224 1;  set 0225 1;  set 0226 1;  set 0227 1
    set 0228 1;  set 0229 1;  set 0230 1;  set 0231 1;  set 0232 1;  set 0233 1
    set 0234 1;  set 0235 1;  set 0236 1;  set 0237 1;  set 0238 1;  set 0239 1
    set 0240 1;  set 0241 1;  set 0242 1;  set 0243 1;  set 0244 1;  set 0245 1
    set 0246 1;  set 0247 1;  set 0248 1;  set 0249 1;  set 0250 1;  set 0251 1
    set 0252 1;  set 0253 1;  set 0254 1;  set 0255 1;  set 0256 1;  set 0257 1
    set 0258 1;  set 0259 1;  set 0260 1;  set 0261 1;  set 0262 1;  set 0263 1
    set 0264 1;  set 0265 1;  set 0266 1;  set 0267 1;  set 0268 1;  set 0269 1
    set 0270 1;  set 0271 1;  set 0272 1;  set 0273 1;  set 0274 1;  set 0275 1
    set 0276 1;  set 0277 1;  set 0278 1;  set 0279 1;  set 0280 1;  set 0281 1
    set 0282 1;  set 0283 1;  set 0284 1;  set 0285 1;  set 0286 1;  set 0287 1
    set 0288 1;  set 0289 1;  set 0290 1;  set 0291 1;  set 0292 1;  set 0293 1
    set 0294 1;  set 0295 1;  set 0296 1;  set 0297 1;  set 0298 1;  set 0299 1
    set 0300 1;  set 0301 1;  set 0302 1;  set 0303 1;  set 0304 1;  set 0305 1
    set 0306 1;  set 0307 1;  set 0308 1;  set 0309 1;  set 0310 1;  set 0311 1
    set 0312 1;  set 0313 1;  set 0314 1;  set 0315 1;  set 0316 1;  set 0317 1
    set 0318 1;  set 0319 1;  set 0320 1;  set 0321 1;  set 0322 1;  set 0323 1
    set 0324 1;  set 0325 1;  set 0326 1;  set 0327 1;  set 0328 1;  set 0329 1
    set 0330 1;  set 0331 1;  set 0332 1;  set 0333 1;  set 0334 1;  set 0335 1
    set 0336 1;  set 0337 1;  set 0338 1;  set 0339 1;  set 0340 1;  set 0341 1
    set 0342 1;  set 0343 1;  set 0344 1;  set 0345 1;  set 0346 1;  set 0347 1
    set 0348 1;  set 0349 1;  set 0350 1;  set 0351 1;  set 0352 1;  set 0353 1
    set 0354 1;  set 0355 1;  set 0356 1;  set 0357 1;  set 0358 1;  set 0359 1
    set 0360 1;  set 0361 1;  set 0362 1;  set 0363 1;  set 0364 1;  set 0365 1
    set 0366 1;  set 0367 1;  set 0368 1;  set 0369 1;  set 0370 1;  set 0371 1
    set 0372 1;  set 0373 1;  set 0374 1;  set 0375 1;  set 0376 1;  set 0377 1
    set 0378 1;  set 0379 1;  set 0380 1;  set 0381 1;  set 0382 1;  set 0383 1
    set 0384 1;  set 0385 1;  set 0386 1;  set 0387 1;  set 0388 1;  set 0389 1
    set 0390 1;  set 0391 1;  set 0392 1;  set 0393 1;  set 0394 1;  set 0395 1
    set 0396 1;  set 0397 1;  set 0398 1;  set 0399 1;  set 0400 1;
    info locals *4?*
}

bench -desc "STR info locals match" \
	-body {proc-locals abc}