See also [Tcl IO performance], where we reached the '''Interim conclusion''' The time spent in the original benchmark seems to be decomposable in * 8% in startup and loop overhead (0.19/2.5) * 20% in command call and setting a variable in the called command (0.50/2.50) ''Further experimentation with a C-coded command that just returns TCL_OK shows that the cost of setting the variable is almost negligible'' * 72% doing the file access, reading and conversion within [gets] itself * the cost of setting the variable in the called command seems to be below the measurable threshold for the larger dataset (read1a actually faster than read2 - the difference ''must'' be noise) ---- Further experiments * on a core instrumented with code developed together with [GPS] * running a tiny do-almost-nothing script * using a command '''empty''' defined in C to just ''return Tcl_Ok;'' provide the following timings for the most-exercised opcodes (measured in cpu ticks at 1.6MHz): ====== 8.5a6 time: 2481129141, count: 20010476 ---------------------------------------------------- op %T avgT %ops Nops 6 43.53 1079.24 5.00 1000825 INST_INVOKE_STK1 80 17.47 433.44 5.00 1000050 INST_LIST_INDEX 105 7.16 44.37 19.99 4000995 INST_START_CMD 29 7.05 87.45 10.00 2000096 INST_INCR_SCALAR1_IMM 10 6.26 31.07 24.99 5001552 INST_LOAD_SCALAR1 103 5.18 128.60 5.00 1000008 INST_LIST_INDEX_IMM 17 4.26 52.80 10.00 2000511 INST_STORE_SCALAR1 47 3.71 92.07 5.00 1000001 INST_LT 1 3.30 40.83 10.01 2002404 INST_PUSH1 3 2.00 49.66 5.00 1000640 INST_POP ======