[Jeffrey Hobbs]: There have been discussions about the changing relative speed of Tcl over the years (primarily rotating around the addition of the byte-code compiler - faster, but then also the changes to support i18n - slower). I created the tclbench [http://tcllib.sf.net/] application to get a better understanding of what has truly happened to performance over the years, with the forward looking view of finding the pain points and fixing them. Anyone can get tclbench from CVS [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcllib/] to do relative benchmarks themselves, but below I've posted the results from a full run over the benchmark suite. The numbers are microseconds, but you should only look at them relative to each other. There is some fluctuation expected as Tcl's 'time' does wall timing, not true cpu time. In any case, these were done on a dual P3-550 with 512MB physmem SuSE 7.3 box. Dual doesn't make any difference - all interpreters were compiled static with no threads. Except for 8.4a5, all represent the final code of that version. 8.4a5 is the head CVS code as of June 11, 2002. 8.4a5 is not an actual release version. A few have noted that these numbers aren't the easiest to read overall, which I can agree with. Take a look at the [Tcl Normalized Benchmarks] that set 8.4a5 as a norm of 1.0 to compare against. If you've got BLT handy, then here is a little code for [Plotting Tcl Benchmarks]. The speed enhancements in 8.4 are primarily achieved by work done by myself and Eric Melski at Ajuba and continued at [ActiveState] [http://www.activestate.com/]. Addition optimizations are also done by [Miguel Sofer]. For those interested in the use of threads for concurrent processing, please see the [Tcl Benchmarks with Threads]. ---- TCL_INTERP: 1:8.4a5 2:8.3.4 3:8.2.3 4:8.0.5 5:7.6p2 STARTED 2002-06-12 09:43:57 (runbench.tcl v1.14) Benchmark 1:8.4a5 /home/jeffh/install/linux-ix86/bin/tclsh8.4 bbccdeeefghkllmmmmpprrssstuvw 00:06:33 elapsed Benchmark 2:8.3.4 /home/jeffh/install/linux-ix86/bin/tclsh8.3 bbccdeeefghkllmmmmpprrssstuvw 00:08:24 elapsed Benchmark 3:8.2.3 /home/jeffh/install/linux-ix86/bin/tclsh8.2 bbccdeeefghkllmmmmpprrssstuvw 00:08:35 elapsed Benchmark 4:8.0.5 /home/jeffh/install/linux-ix86/bin/tclsh8.0 bbccdeeefghkllmmmmpprrssstuvw 00:07:08 elapsed Benchmark 5:7.6p2 /home/jeffh/install/linux-ix86/bin/tclsh7.6 bbccdeeefghkllmmmmpprrssstuvw 00:20:31 elapsed 000 VERSIONS: 1:8.4a5 2:8.3.4 3:8.2.3 4:8.0.5 5:7.6p2 001 BASE64 decode 10 464 499 468 469 -=- 002 BASE64 decode 100 3797 3989 3888 3928 -=- 003 BASE64 decode 1000 36510 38943 37827 38440 -=- 004 BASE64 decode 10000 366342 385948 382213 387465 -=- 005 BASE64 decode2 10 452 479 454 460 -=- 006 BASE64 decode2 100 3704 3834 3758 3816 -=- 007 BASE64 decode2 1000 35581 37263 36551 37617 -=- 008 BASE64 decode2 10000 355335 369594 370762 377364 -=- 009 BASE64 encode 10 285 362 338 387 -=- 010 BASE64 encode 100 2310 2995 2960 3451 -=- 011 BASE64 encode 1000 22290 29228 28758 33732 -=- 012 BASE64 encode 10000 220536 292788 289834 338588 -=- 013 BASE64 encode2 10 262 349 325 371 -=- 014 BASE64 encode2 100 2085 2917 2788 3371 -=- 015 BASE64 encode2 1000 20179 28376 27273 33082 -=- 016 BASE64 encode2 10000 201395 282214 273864 330721 -=- 017 BIN bitset-v1 1000 chars 16221 16170 15642 14164 -=- 018 BIN bitset-v1 5000 chars 78676 78933 78327 70558 -=- 019 BIN bitset-v1 10000 chars 158121 158762 157722 142115 -=- 020 BIN bitset-v2 1000 chars 7314 10216 9097 8126 -=- 021 BIN bitset-v2 5000 chars 37069 50580 45404 40151 -=- 022 BIN bitset-v2 10000 chars 71100 101024 91352 80160 -=- 023 BIN bitset-v3 1000 chars 2584 4780 4606 4060 -=- 024 BIN bitset-v3 5000 chars 11715 23635 22688 19996 -=- 025 BIN bitset-v3 10000 chars 23700 48114 46351 41059 -=- 026 BIN c scan, 1000b 597 403 389 308 -=- 027 BIN c scan, 5000b 1987 1897 1842 1452 -=- 028 BIN c scan, 10000b 3693 3757 3786 3113 -=- 029 CATCH error, complex 34 32 30 27 31 030 CATCH no catch used 8 7 6 6 15 031 CATCH return error 32 30 29 25 31 032 CATCH return except 8 7 6 6 19 033 CATCH return ok 8 7 6 6 21 034 DATA access in a list 1166 2039 1798 1720 40453 035 DATA access in an array 1510 2058 2072 1831 7163 036 DATA create in a list 988 2172 2162 2072 6563 037 DATA create in an array 2726 2692 2613 3265 8368 038 ENC iso2022-jp, gets 10715 9564 9910 -=- -=- 039 ENC iso2022-jp, read 10837 9407 9699 -=- -=- 040 ENC iso2022-jp, read & size 10572 9439 9720 -=- -=- 041 ENC iso8859-2, gets 1026 626 580 -=- -=- 042 ENC iso8859-2, read 854 457 445 -=- -=- 043 ENC iso8859-2, read & size 855 466 453 -=- -=- 044 EVAL cmd and mixed lists 1703 1422 3863 2713 564 045 EVAL cmd eval as list 9 10 29 26 11 046 EVAL cmd eval as string 27 24 30 26 12 047 EVAL cmd eval in list obj var 10 11 30 27 15 048 EVAL list cmd and mixed lists 1700 1417 3890 2714 566 049 EVAL list cmd and pure lists 231 234 3866 2712 566 050 EXPR $a != $b int 6 6 5 5 41 051 EXPR $a != $b str (!= len) 15 16 14 13 60 052 EXPR $a != $b str (== len) 18 16 14 13 58 053 EXPR $a == $b int 6 6 5 5 40 054 EXPR $a == $b str (!= len) 15 16 14 13 58 055 EXPR $a == $b str (== len) 18 16 15 13 60 056 EXPR braced 14 12 12 10 78 057 EXPR fifty operands 23 21 21 18 84 058 EXPR incr with expr 4 3 3 3 15 059 EXPR incr with incr 5 5 4 3 11 060 EXPR inline 14 13 13 11 36 061 EXPR one operand 3 3 3 3 13 062 EXPR ten operands 7 6 6 5 27 063 EXPR unbraced 100 90 91 74 76 064 FCOPY binary: 160K 8160 8035 7979 -=- -=- 065 FCOPY encoding: 160K 30946 7937 7932 -=- -=- 066 FCOPY std: 160K 8120 7877 8161 8252 8264 067 GCCont_cpb::cGCC 50 355 592 610 510 -=- 068 GCCont_cpb::cGCC 500 1542 3525 3907 3137 -=- 069 GCCont_cpb::cGCC 5000 13378 33361 36699 29624 -=- 070 GCCont_cpbre1::cGCC 50 396 393 -=- -=- -=- 071 GCCont_cpbre1::cGCC 500 2456 2473 -=- -=- -=- 072 GCCont_cpbre1::cGCC 5000 23042 23283 -=- -=- -=- 073 GCCont_cpbre2::cGCC 50 320 324 -=- -=- -=- 074 GCCont_cpbre2::cGCC 500 2251 2271 -=- -=- -=- 075 GCCont_cpbre2::cGCC 5000 21580 21742 -=- -=- -=- 076 GCCont_cpbrs2::cGCC 50 110 348 346 -=- -=- 077 GCCont_cpbrs2::cGCC 500 390 2593 2603 -=- -=- 078 GCCont_cpbrs2::cGCC 5000 3150 24967 25079 -=- -=- 079 GCCont_cpbrs::cGCC1 50 194 536 527 376 -=- 080 GCCont_cpbrs::cGCC1 500 500 2924 2919 706 -=- 081 GCCont_cpbrs::cGCC1 5000 3515 26500 26592 3949 -=- 082 GCCont_cpbrs::cGCC2 50 180 585 574 356 -=- 083 GCCont_cpbrs::cGCC2 500 447 3045 3036 642 -=- 084 GCCont_cpbrs::cGCC2 5000 3090 27375 27461 3303 -=- 085 GCCont_cpbrs_trap::cGCC 50 357 377 374 229 -=- 086 GCCont_cpbrs_trap::cGCC 500 2347 2476 2476 1197 -=- 087 GCCont_cpbrs_trap::cGCC 5000 22233 23356 23402 10825 -=- 088 GCCont_expr::cGCC 50 237 249 248 -=- -=- 089 GCCont_expr::cGCC 500 3086 3208 3220 -=- -=- 090 GCCont_expr::cGCC 5000 423321 425379 425948 -=- -=- 091 GCCont_i::cGCC1 50 482 462 482 429 -=- 092 GCCont_i::cGCC1 500 4371 4039 4407 3918 -=- 093 GCCont_i::cGCC1 5000 43979 40719 43601 39633 -=- 094 GCCont_i::cGCC2 50 180 221 242 197 -=- 095 GCCont_i::cGCC2 500 1365 1743 2055 1691 -=- 096 GCCont_i::cGCC2 5000 13179 17000 20201 16701 -=- 097 GCCont_i::cGCC3 50 166 211 233 186 -=- 098 GCCont_i::cGCC3 500 1204 1630 1938 1570 -=- 099 GCCont_i::cGCC3 5000 11606 15628 19130 15485 -=- 100 GCCont_r1::cGCC 50 725 683 730 578 -=- 101 GCCont_r1::cGCC 500 6850 6575 7052 5565 -=- 102 GCCont_r1::cGCC 5000 68906 65633 70202 55543 -=- 103 GCCont_r2::cGCC 50 536 472 557 434 -=- 104 GCCont_r2::cGCC 500 4982 4261 5202 4092 -=- 105 GCCont_r2::cGCC 5000 49051 42921 51609 40670 -=- 106 GCCont_r3::cGCC 50 551 480 559 433 -=- 107 GCCont_r3::cGCC 500 5113 4338 5235 4031 -=- 108 GCCont_r3::cGCC 5000 50351 44229 51906 40608 -=- 109 GCCont_rsf1::cGCC 50 219 240 288 -=- -=- 110 GCCont_rsf1::cGCC 500 1363 1589 2194 -=- -=- 111 GCCont_rsf1::cGCC 5000 12729 15100 21371 -=- -=- 112 GCCont_rsf2::cGCC1 50 152 181 201 -=- -=- 113 GCCont_rsf2::cGCC1 500 756 1054 1295 -=- -=- 114 GCCont_rsf2::cGCC1 5000 6722 9682 12306 -=- -=- 115 GCCont_rsf2::cGCC2 50 130 147 165 -=- -=- 116 GCCont_rsf2::cGCC2 500 723 957 1201 -=- -=- 117 GCCont_rsf2::cGCC2 5000 6587 8997 11631 -=- -=- 118 GCCont_rsf3::cGCC 50 135 147 165 -=- -=- 119 GCCont_rsf3::cGCC 500 724 956 1201 -=- -=- 120 GCCont_rsf3::cGCC 5000 6592 9010 11552 -=- -=- 121 GCCont_turing::cGCC 50 81 142 140 -=- -=- 122 GCCont_turing::cGCC 500 285 836 833 -=- -=- 123 GCCont_turing::cGCC 5000 2334 8084 8013 -=- -=- 124 HEAPSORT size 10 596 570 536 4770 3270 125 HEAPSORT size 50 4088 3850 3674 27396 24999 126 HEAPSORT size 100 9284 8795 8355 57764 57996 127 IF 1/0 check 6 7 6 6 26 128 IF else true al 17 15 14 12 44 129 IF else true numeric 8 8 7 7 38 130 IF elseif true al 14 15 14 12 43 131 IF elseif true numeric 8 8 8 7 39 132 IF if false al/al 12 10 9 8 32 133 IF if false al/num 11 9 8 7 53 134 IF if false num/num 7 7 6 6 33 135 IF if true al 6 10 9 8 34 136 IF if true al/al 7 10 10 8 32 137 IF if true num/num 7 7 6 6 32 138 IF if true numeric 6 6 6 5 31 139 IF multi 1st true 7 7 6 6 50 140 IF multi 2nd true 8 8 7 7 53 141 IF multi 9th true 16 16 15 14 90 142 IF multi default true 16 16 15 14 92 143 KLIST shuffle0 llength 1 53 74 70 68 8.0+ 144 KLIST shuffle0 llength 10 138 227 213 196 8.0+ 145 KLIST shuffle0 llength 100 1089 1837 1754 1566 8.0+ 146 KLIST shuffle0 llength 1000 12852 19678 19084 16929 8.0+ 147 KLIST shuffle0 llength 10000 168938 236865 232892 209154 -=- 148 KLIST shuffle1-s llength 1 50 47 45 34 120 149 KLIST shuffle1-s llength 10 229 215 212 209 918 150 KLIST shuffle1-s llength 100 2921 2905 2596 2308 15815 151 KLIST shuffle1-s llength 1000 277907 271559 242657 237562 935640 152 KLIST shuffle1a llength 1 59 54 52 39 152 153 KLIST shuffle1a llength 10 253 237 244 233 1194 154 KLIST shuffle1a llength 100 2400 2183 2337 2153 19984 155 KLIST shuffle1a llength 1000 24093 21905 23369 21589 1149611 156 KLIST shuffle1a llength 10000 241123 221366 235202 219042 -=- 157 KLIST shuffle2 llength 1 58 66 63 65 155 158 KLIST shuffle2 llength 10 268 280 268 350 986 159 KLIST shuffle2 llength 100 2499 2549 2409 3171 9379 160 KLIST shuffle2 llength 1000 25308 25885 24170 31646 94437 161 KLIST shuffle2 llength 10000 268976 274684 261764 342243 -=- 162 KLIST shuffle3 llength 1 49 57 54 44 116 163 KLIST shuffle3 llength 10 192 231 237 235 882 164 KLIST shuffle3 llength 100 1798 2042 2188 1980 10552 165 KLIST shuffle3 llength 1000 19853 21851 22971 20590 347998 166 KLIST shuffle3 llength 10000 418352 442875 461044 428850 -=- 167 KLIST shuffle4 llength 1 49 59 58 45 131 168 KLIST shuffle4 llength 10 203 248 254 252 1007 169 KLIST shuffle4 llength 100 1879 2207 2301 2116 14229 170 KLIST shuffle4 llength 1000 18752 21719 22959 20814 664693 171 KLIST shuffle4 llength 10000 188601 218366 233330 210288 -=- 172 KLIST shuffle5-s llength 1 22 22 21 18 90 173 KLIST shuffle5-s llength 10 154 142 129 109 645 174 KLIST shuffle5-s llength 100 1771 1582 1359 1112 7304 175 KLIST shuffle5-s llength 1000 79980 78225 60585 59486 207499 176 KLIST shuffle5a llength 1 26 25 24 20 103 177 KLIST shuffle5a llength 10 153 141 132 113 776 178 KLIST shuffle5a llength 100 1369 1221 1168 1026 8855 179 KLIST shuffle5a llength 1000 14865 13486 12875 12164 268849 180 KLIST shuffle5a llength 10000 371924 350596 342108 342904 -=- 181 LIST append to list 7 16 14 13 11 182 LIST concat APPEND 2x10 46 47 45 36 21 183 LIST concat APPEND 2x100 248 254 252 205 65 184 LIST concat APPEND 2x1000 2331 2320 2374 1934 462 185 LIST concat APPEND 2x10000 26453 26433 26387 23107 4845 186 LIST concat CONCAT 2x10 15 15 32 26 25 187 LIST concat CONCAT 2x100 22 22 202 163 86 188 LIST concat CONCAT 2x1000 113 112 2006 1660 637 189 LIST concat CONCAT 2x10000 1124 1024 22217 19207 6633 190 LIST concat EVAL/LAPPEND 2x10 26 26 49 44 35 191 LIST concat EVAL/LAPPEND 2x100 37 38 122 104 135 192 LIST concat EVAL/LAPPEND 2x1000 155 157 860 722 1064 193 LIST concat EVAL/LAPPEND 2x10000 1753 1746 9400 7101 11086 194 LIST concat FOREACH/LAPPEND 2x10 29 48 46 41 59 195 LIST concat FOREACH/LAPPEND 2x100 153 331 317 290 365 196 LIST concat FOREACH/LAPPEND 2x1000 1396 3153 3060 2775 3377 197 LIST concat FOREACH/LAPPEND 2x10000 14117 31493 30832 27998 33979 198 LIST concat SET 2x10 32 32 30 25 21 199 LIST concat SET 2x100 206 208 207 169 70 200 LIST concat SET 2x1000 1990 2021 2005 1629 509 201 LIST concat SET 2x10000 22174 22072 22178 19314 5352 202 LIST exact search, first item 8 7 6 5 431 203 LIST exact search, last item 37 32 31 29 448 204 LIST exact search, middle item 17 14 13 11 439 205 LIST exact search, non-item 101 92 91 86 470 206 LIST exact search, typed item 31 32 31 29 448 207 LIST exact search, untyped item 37 32 31 29 448 208 LIST index first element 7 6 5 5 143 209 LIST index last element 7 6 5 5 176 210 LIST index middle element 7 6 5 5 159 211 LIST insert an item at "end" 116 114 115 110 383 212 LIST insert an item at middle 124 121 120 119 238 213 LIST insert an item at start 124 122 121 118 222 214 LIST iterate list 2417 4053 3636 3422 352602 215 LIST join list 613 613 614 389 1123 216 LIST large, early range 16 14 13 11 174 217 LIST large, late range 15 14 13 12 183 218 LIST length, pure list 6 7 6 5 502 219 LIST list 24 24 22 21 59 220 LIST remove first element 122 121 121 119 190 221 LIST remove in mixed list 139 132 1106 130 236 222 LIST remove last element 121 119 120 117 254 223 LIST remove middle element 122 121 120 117 236 224 LIST replace first el with multiple 125 122 122 121 233 225 LIST replace first element 117 115 114 111 222 226 LIST replace in mixed list 132 126 1096 124 240 227 LIST replace last el with multiple 118 116 116 113 397 228 LIST replace last element 117 115 114 110 389 229 LIST replace middle el with multiple 122 121 119 118 321 230 LIST replace middle element 117 115 115 111 312 231 LIST replace range 117 113 114 109 281 232 LIST small, early range 10 9 9 7 147 233 LIST small, late range 10 9 9 7 175 234 LIST sort 1607 1600 1561 1507 1550 235 LIST sorted search, first item 9 7 6 5 431 236 LIST sorted search, last item 9 32 31 29 448 237 LIST sorted search, middle item 9 14 12 11 439 238 LIST sorted search, non-item 9 92 91 86 470 239 LIST sorted search, typed item 9 32 31 29 448 240 LIST typed sort 1379 1382 1337 1091 5496 241 LOOP for (to 1000) 1526 1612 1568 1527 11995 242 LOOP for, iterate list 2201 3011 2759 2527 147127 243 LOOP for, iterate string 3205 4046 4303 3448 37430 244 LOOP foreach, iterate list 1235 1198 1175 1096 3305 245 LOOP foreach, iterate string 1477 1405 2139 1882 3095 246 LOOP while (to 1000) 1529 1611 1566 1527 12234 247 LOOP while 1 (to 1000) 1188 1654 1548 1446 13166 248 MAP ([chars])-case regsub 176 179 178 34 54 249 MAP http mapReply 165686 164890 164651 153668 22482 250 MAP regsub -nocase, no match 1888 1654 1652 932 1236 251 MAP regsub 1 val 347 2673 2668 434 865 252 MAP regsub 1 val -nocase 1102 2672 2679 594 1073 253 MAP regsub 2 val 874 11854 11811 1097 1891 254 MAP regsub 2 val -nocase 2226 11849 11829 1434 2279 255 MAP regsub 3 val 1152 16175 16186 1498 2493 256 MAP regsub 3 val -nocase 3144 16155 16182 1984 3025 257 MAP regsub 4 val 1504 20428 20452 1878 3078 258 MAP regsub 4 val -nocase 4058 20434 20452 2511 3759 259 MAP regsub short 27 112 110 26 55 260 MAP regsub, no match 313 1655 1652 602 799 261 MAP string -nocase, no match 2124 11904 11912 nomap nomap 262 MAP string 1 val 316 4091 4142 nomap nomap 263 MAP string 1 val -nocase 1085 6428 6430 nomap nomap 264 MAP string 2 val 813 4984 5024 nomap nomap 265 MAP string 2 val -nocase 2080 9349 9380 nomap nomap 266 MAP string 3 val 1005 5950 5989 nomap nomap 267 MAP string 3 val -nocase 2714 12169 12190 nomap nomap 268 MAP string 4 val 1276 6410 6467 nomap nomap 269 MAP string 4 val -nocase 3341 14162 14064 nomap nomap 270 MAP string short 20 22 22 nomap nomap 271 MAP string, no match 493 5910 5980 nomap nomap 272 MAP |-case regsub 88 86 84 26 41 273 MAP |-case strmap 20 26 25 nomap nomap 274 MATRIX mult 5x5 543 717 699 590 3543 275 MATRIX mult 10x10 3451 4373 4289 3598 25940 276 MATRIX mult 15x15 10939 13652 13443 11268 92037 277 MATRIX transposition-0 4584 11099 10568 8630 28533 278 MATRIX transposition-1 3412 7627 6606 6055 108282 279 MD5 msg len 10 1674 1431 1326 1314 -=- 280 MD5 msg len 100 2899 2517 2331 2346 -=- 281 MD5 msg len 1000 20122 17786 16466 16910 -=- 282 MD5 msg len 10000 194617 171951 160336 163393 -=- 283 MTHD array stored proc call 6 5 4 4 -=- 284 MTHD call absolute 10 16 12 13 -=- 285 MTHD call relative 16 16 13 13 -=- 286 MTHD direct ns proc call 4 3 3 3 -=- 287 MTHD imported ns proc call 4 3 3 3 -=- 288 MTHD indirect proc eval 14 14 32 30 -=- 289 MTHD indirect proc eval #2 27 25 30 29 -=- 290 MTHD inline call 2 2 1 1 -=- 291 MTHD interp alias proc call 12 10 9 4 -=- 292 MTHD ns lookup call 50 49 66 56 -=- 293 MTHD switch method call 22 21 40 40 -=- 294 PARSE html form upload (7820) 11750 11960 11563 10787 -=- 295 PARSE html form upload (974068) 1429055 1466084 1424928 1338379 -=- 296 PROC do-nothing, no args 3 3 14 2 1 297 PROC do-nothing, one arg 3 3 3 2 4 298 PROC empty, no args 1 3 15 2 4 299 PROC empty, use args 1 4 4 3 6 300 PROC explicit return 3 4 3 3 6 301 PROC explicit return (2) 3 4 3 3 5 302 PROC explicit return (3) 3 4 3 3 5 303 PROC heavily commented 3 3 2 2 194 304 PROC implicit return 4 3 3 3 8 305 PROC implicit return (2) 4 3 3 3 6 306 PROC implicit return (3) 3 3 3 2 4 307 PROC local links with global 672 661 657 639 1574 308 PROC local links with upvar 601 596 588 586 1584 309 PROC local links with variable 578 565 549 341 1555 310 RE 1-char long-end 48 46 45 585 623 311 RE 1-char long-end catching 91 90 86 603 634 312 RE 1-char long-middle 33 31 29 298 336 313 RE 1-char long-middle catching 76 75 71 316 346 314 RE 1-char long-start 17 16 14 11 49 315 RE 1-char long-start catching 61 58 57 30 59 316 RE 1-char short 17 16 14 11 13 317 RE 1-char short catching 61 58 55 29 24 318 RE basic 15 15 12 11 14 319 RE basic catching 65 63 61 27 23 320 RE c-comment long 57 58 57 85 125 321 RE c-comment long catching 183 179 176 112 147 322 RE c-comment long nomatch 83 80 79 17 89 323 RE c-comment long nomatch catching 84 79 80 17 90 324 RE c-comment long pmatch 89 88 90 556 632 325 RE c-comment long pmatch catching 90 88 86 557 633 326 RE c-comment many *s 92 91 89 159 234 327 RE c-comment many *s catching 286 284 283 193 269 328 RE c-comment nomatch 21 22 20 9 14 329 RE c-comment nomatch catching 22 21 19 9 14 330 RE c-comment simple 36 35 33 21 25 331 RE c-comment simple catching 138 134 132 40 36 332 RE count all matches 99 98 285 241 494 333 RE extract all matches 118 116 344 288 652 334 RE literal regexp 24 23 20 15 15 335 RE n-char long-end 49 46 46 663 702 336 RE n-char long-end catching 101 99 96 682 713 337 RE n-char long-middle 34 31 30 336 375 338 RE n-char long-middle catching 86 84 81 355 386 339 RE n-char long-start 18 17 14 11 48 340 RE n-char long-start catching 70 68 66 30 60 341 RE n-char short 18 17 14 11 14 342 RE n-char short catching 69 67 65 30 24 343 RE static long match 17 34 33 23 58 344 RE static long nomatch 26 48 47 25 60 345 RE static short match 4 15 14 7 8 346 RE static short nomatch 4 10 8 6 8 347 RE var-based regexp 25 24 22 16 19 348 READ 595K, gets 232204 245797 198367 103926 172076 349 READ 595K, read 51274 56335 57540 224154 225270 350 READ 595K, read & size 51365 56447 57721 17737 225052 351 READ 3050b, gets 1251 1339 1102 603 991 352 READ 3050b, read 346 346 344 158 186 353 READ 3050b, read & size 359 356 354 164 200 354 READ bin 595K, gets 232143 251617 206222 103582 172421 355 READ bin 595K, read 12599 12225 13817 223146 226204 356 READ bin 595K, read & size 12677 12248 13924 17716 225408 357 READ bin 3050b, gets 1290 1392 1152 614 991 358 READ bin 3050b, read 152 150 147 173 193 359 READ bin 3050b, read & size 166 162 157 179 207 360 SHA sha1 msg len 10 4118 3737 3568 3902 -=- 361 SHA sha1 msg len 100 7622 6992 6634 7326 -=- 362 SHA sha1 msg len 1000 57170 52946 49779 55530 -=- 363 SHA sha1 msg len 10000 555352 510738 488639 539328 -=- 364 SHA sha1DF msg len 10 1651 2177 2014 1781 -=- 365 SHA sha1DF msg len 100 3160 4198 3886 3433 -=- 366 SHA sha1DF msg len 1000 24282 32363 30033 26613 -=- 367 SHA sha1DF msg len 10000 236890 317924 296315 260292 -=- 368 STARTUP time to launch tclsh 12903 11175 11496 11868 5747 369 STR append 57 43 36 29 247 370 STR append (1KB + 1KB) 24 32 30 24 147 371 STR append (1MB + (1b + 1K + 1b) * 100) 8824 17002 17196 17070 118737 372 STR append (1MB + 1KB * 20) 7555 15918 16258 16245 115071 373 STR append (1MB + 1KB * 1000) 15986 26103 25309 24986 158457 374 STR append (1MB + 1KB) 7397 15772 16104 16113 114249 375 STR append (1MB + 1MB * 3) 32200 40308 40545 40552 328092 376 STR append (1MB + 1MB * 5) 40347 79205 78748 78745 428951 377 STR append (1MB + 2b * 1000) 9323 20065 19603 19515 119254 378 STR append (10KB + 1KB) 53 89 85 79 647 379 STR first (failure) 44 35 34 33 188 380 STR first (failure) utf 44 133 129 32 189 381 STR first (success) 8 9 7 6 152 382 STR first (success) utf 8 10 9 6 151 383 STR first (total failure) 37 16 15 15 180 384 STR first (total failure) utf 37 18 16 15 180 385 STR index 0 9 10 9 7 177 386 STR index 100 10 10 9 7 178 387 STR index 500 9 10 9 7 177 388 STR info locals match 489 516 505 489 1436 389 STR last (failure) 58 64 62 49 188 390 STR last (success) 8 132 131 6 192 391 STR last (total failure) 45 51 50 35 180 392 STR length (==4010) 6 6 6 5 177 393 STR length of a LIST 5 6 5 5 172 394 STR length static str 3 6 5 5 20 395 STR match, complex (failure) 88 626 625 262 403 396 STR match, complex (success early) 8 13 12 8 148 397 STR match, complex (success late) 104 637 636 267 407 398 STR match, complex (total failure) 73 615 615 256 396 399 STR match, exact (failure) 4 5 4 4 7 400 STR match, exact (success) 4 6 5 4 7 401 STR match, exact -nocase (failure) 4 6 5 ERR ERR 402 STR match, exact -nocase (success) 7 8 7 ERR ERR 403 STR match, simple (failure) 4 5 4 4 9 404 STR match, simple (success) 4 5 4 4 10 405 STR range, index 100..200 of 4010 11 11 10 7 181 406 STR repeat, 4010 chars * 10 90 92 179 214 1791 407 STR repeat, 4010 chars * 100 1575 1597 3388 3704 15689 408 STR repeat, abcdefghij * 10 8 8 11 43 164 409 STR repeat, abcdefghij * 100 26 26 49 346 1345 410 STR repeat, abcdefghij * 1000 212 213 400 3423 13158 411 STR replace, equal replacement 42 179 175 28 400 412 STR replace, longer replacement 45 177 175 27 401 413 STR replace, no replacement 42 176 174 26 400 414 STR reverse iter/append, 10 c 47 87 82 65 176 415 STR reverse iter/append, 10 uc 47 87 81 65 176 416 STR reverse iter/append, 100 c 314 697 656 508 1666 417 STR reverse iter/append, 100 uc 313 681 640 508 1655 418 STR reverse iter/append, 400 c 1204 2743 2596 1964 9820 419 STR reverse iter/append, 400 uc 1190 2695 2501 1976 9899 420 STR reverse iter/set, 10 c 52 63 65 52 181 421 STR reverse iter/set, 10 uc 51 63 63 52 182 422 STR reverse iter/set, 100 c 418 508 525 441 1804 423 STR reverse iter/set, 100 uc 423 502 528 439 1795 424 STR reverse iter/set, 400 c 1760 2116 2174 1794 11874 425 STR reverse iter/set, 400 uc 1759 2117 2196 1781 12093 426 STR reverse recursive, 10 c 118 145 137 105 330 427 STR reverse recursive, 10 uc 115 147 138 106 331 428 STR reverse recursive, 100 c 1162 1483 1388 1083 3473 429 STR reverse recursive, 100 uc 1154 1904 1804 1081 3474 430 STR reverse recursive, 400 c 5002 6249 5941 4643 8.0+ 431 STR reverse recursive, 400 uc 6013 14137 14000 4631 8.0+ 432 STR split iter, 4000 uchars 6157 5892 8600 7494 12514 433 STR split iter, 4010 chars 6114 5845 8567 7506 12501 434 STR split iter, rand 100 c 293 287 230 195 -=- 435 STR split iter, rand 1000 c 1959 1892 2138 1866 -=- 436 STR split iter, rand 10000 c 15783 15188 22077 18721 -=- 437 STR split, 4000 uchars 1290 1197 3863 3014 1059 438 STR split, 4010 chars 1233 1154 3885 3067 1030 439 STR split, rand 100 c 167 163 111 85 -=- 440 STR split, rand 1000 c 751 725 1013 783 -=- 441 STR split, rand 10000 c 3752 3494 10105 7780 -=- 442 STR str $a eq $b 11 16 15 14 52 443 STR str $a eq $b (same obj) 11 16 15 14 52 444 STR str $a equal "" 8 11 11 9 64 445 STR str $a ne $b 12 17 15 15 49 446 STR str $a ne $b (same obj) 11 17 15 14 50 447 STR str num == "" 8 8 9 8 64 448 STR string compare 10 13 11 11 21 449 STR string compare "" 9 11 11 12 40 450 STR string compare long 136 132 129 129 660 451 STR string compare long (same obj) 9 131 129 129 664 452 STR string compare mixed long 191 136 134 133 665 453 STR string compare uni long 135 149 148 129 661 454 STR string equal "" 8 11 11 12 40 455 STR string equal long (!= len) 17 143 142 140 724 456 STR string equal long (== len) 105 135 133 133 722 457 STR string equal long (same obj) 12 134 132 132 724 458 STR string equal mixed long 12 135 133 132 724 459 STR string equal uni long 119 152 152 132 724 460 STR/LIST length, obj shimmer 1206 1211 1207 8 652 461 SWITCH 1st true 19 16 15 14 47 462 SWITCH 2nd true 20 16 15 14 47 463 SWITCH 9th true 21 19 18 16 48 464 SWITCH default true 22 19 18 17 49 465 TRACE all set (rwu) 18 15 15 14 23 466 TRACE no trace set 18 15 15 14 23 467 TRACE read 18 15 15 14 23 468 TRACE unset 18 15 15 14 23 469 TRACE write 18 15 14 13 23 470 UNSET catch var !exist 38 36 35 31 21 471 UNSET catch var exists 6 5 5 5 12 472 UNSET info check var !exist 6 5 5 5 13 473 UNSET info check var exists 8 8 7 7 15 474 UNSET nocomplain var !exist 5 36 34 30 22 475 UNSET nocomplain var exists 6 5 5 5 13 476 UNSET var exists 6 5 4 4 7 477 VAR 'array set' of 100 elems 169 156 158 139 243 478 VAR 100 'set's in array 89 81 79 80 231 479 VAR access global 9 15 14 13 22 480 VAR access local proc arg 6 5 5 5 19 481 VAR access locally set 5 5 5 5 18 482 VAR access upvar 12 18 17 15 22 483 VAR mset 12 16 14 14 57 484 VAR mset (foreach) 8 8 7 7 30 485 VAR ref absolute 350 327 331 266 8.0+ 486 VAR ref variable 75 163 160 139 8.0+ 487 VAR set array element 9 7 6 6 9 488 VAR set scalar 4 3 3 3 8 489 WORDCOUNT wc1 3026 3075 2973 1132 1844 490 WORDCOUNT wc2 786 1741 1743 673 1016 491 WORDCOUNT wc3 720 1648 1660 594 732 491 BENCHMARKS 1:8.4a5 2:8.3.4 3:8.2.3 4:8.0.5 5:7.6p2 FINISHED 2002-06-12 10:35:08 ---- [JH]: The numbers below by Kevin are for the previous set of numbers, and need updating. The only thing likely to change though is to show that 8.4 is pulling ahead in performance. [Kevin Kenny]: For those that insist on a single figure of merit, I took these numbers, normalized them to a scale of 8.4a3 == 1.0, and then took the harmonic mean of all benchmarks. ---- Version Relative Speed Comments ---- 7.6p2 0.125 The last version without bytecode compilation ---- 8.0.5 0.736 Bytecode compilation initially sped things up by a factor of about 6. ---- 8.2.3 0.600 The cost of internationalization was that things got about 20% slower. ---- 8.3.1 0.606 Not much change here.... ---- 8.4a3 1.000 The reference against which the others were measured. Many more operations are bytecoded, which gains about 50% in speed. ---- As with all benchmarks, take these numbers with a spoonful of salt!