Measuring performance in Tcl (or any other language for that matter) is ''not'' simple. In particular, it is tricky to ensure that what you are actually measuring is what you think you are measuring, and that you are not instead measuring something completely different. ---- Before anything else, '''time''' it! Tcl has a wonderful '''time''' command, which can help you answer questions like "Is this code faster than that code?" Check out the man page. Or check out this example of [Counting Elements in a List] which includes a basic timing framework. If you need to record time stamps (e.g., event driven Tk applications), then take a look at '''clock clicks''' which gives you a (platform dependent) time stamp. Sometimes you may want to '''profile''' an application to find out where all the time is spent. There are several solutions. See [Profiling Tcl] for some suggestions. One idea is to build in time routines into an extension or application. For instance, md5pure::time lets anyone time the md5pure extension and compare the results to those of others (see the chart of timings at the md5pure home page [http://expect.nist.gov/md5pure]). ---- Allow me to shamelessly plug my package ''timers.tcl'': [http://www.purl.org/mini/tcl/671.html] -PSE ---- DKF: '''You should be aware of the fact that UNIX has a much smaller time granularity than Windows''' (certainly 95/98 and quite probably NT too.) (''KBK'' (24 December 2000) -- The problem with Windows clock resolution is fixed in the latest alpha of 8.4.) The best way to benchmark a tiny snippet of Tcl (especially where it is platform-independent code you're testing) is to use a slow UNIX box. The slowness of its operation allows for sensitivity and the fine granularity of its timer lets you pick up what differences there are. And then you have to pray that the relative speeds scale as you move to different platforms/architectures and/or faster machines. Which is usually a good assumption if you're not shimmering between numbers and strings (where performance seems to vary a lot according to the vendor's implementation of the C library.) Unix has millisecond-sized granularity (i.e. around 1000Hz or 1kHz.) Windows has, for reasons relating to the hardware used in the original IBM-PC, 42.7Hz (or thereabouts) granularity. (''KBK'' (24 Dec 2000) -- The latest 8.4 alpha uses the 1.193 MHz 8254 timer in place of the Windows 1- or 10-ms time quantum.) Obviously, this makes it harder to perform finer measurements. Good thing most operations in Tcl are actually platform-independent, so the relative differences in execution speed tend to carry across. ''KBK'' - The patch for using the 8254 clock in earlier Tcl releases is at [http://www.deja.com/getdoc.xp?AN=666545441&fmt=text]. Note that multi-CPU Windows systems are still going to be limited to the 1-ms resolution, because of a bug in the Hardware Abstraction Layer that Microsoft ships. ---- ''Remember'', the actual numerical performance of computers varies widely with operating system and processor speed, and comparing actual figures is very tricky. If you're going to put up benchmarking info, at least do everyone the favour of [Finding Out Your Processor and Operating System Configuration]... m