For information on the benchmark suite used, please see
Tcl Benchmarks.
Tcl 8.4b1 introduces a new allocator for use when threads are enabled that significantly reduces lock contention. This allocator had its origins in AOLServer modifications to the Tcl core to enable AOLServer to have such high performance in a multi-threaded environment. This has significant, positive performance implications when multiple threads are in use. The key is in reducing lock contention by creating per-thread Tcl_Obj pools.
Tests are done on a dual PIII-Xeon 550 with 512MB ram running SuSE 7.3 kernel 2.4.10-64GB-SMP. In the all cases where threading is used, there is some overhead in the total elapsed time for all the thread management versus sequential sourcing of the files, which is what the non-threaded versions use.
This set of tests was run with expr.bench (a small benchmark for some expr operations) repeated 25 times. That is, if no threads were used, expr.bench would be sourced 25 times. If 2 threads were used, two threads would share the processing until they had sourced expr.bench 25 times between them (not each). This was to test the value of the reduced lock contention. In this particular set of tests, there is *zero value* to using threads, this just compares performance on obj allocation and usage in the across threads.
tclsh8.4-aol is the new threaded allocator in a threaded build
tclsh8.4t is the old allocator (malloc pooling) in a threaded build
tclsh8.4 is a simple, non-threaded build.
no use of threads: (run in process)
Benchmark 1:8.4a5 tclsh8.4-aol 00:00:06 elapsed
Benchmark 2:8.4a5 tclsh8.4t 00:00:06 elapsed
Benchmark 3:8.4a5 tclsh8.4 00:00:05 elapsed
1 thread:
Benchmark 1:8.4a5 tclsh8.4-aol 00:00:08 elapsed
Benchmark 2:8.4a5 tclsh8.4t 00:00:08 elapsed
Benchmark 3:8.4a5 tclsh8.4 00:00:05 elapsed
2 threads:
Benchmark 1:8.4a5 tclsh8.4-aol 00:00:04 elapsed
Benchmark 2:8.4a5 tclsh8.4t 00:00:12 elapsed
Benchmark 3:8.4a5 tclsh8.4 00:00:04 elapsed
4 threads:
Benchmark 1:8.4a5 tclsh8.4-aol 00:00:08 elapsed
Benchmark 2:8.4a5 tclsh8.4t 00:00:24 elapsed
Benchmark 3:8.4a5 tclsh8.4 00:00:05 elapsed
8 threads:
Benchmark 1:8.4a5 tclsh8.4-aol 00:00:12 elapsed
Benchmark 2:8.4a5 tclsh8.4t 00:00:29 elapsed
Benchmark 3:8.4a5 tclsh8.4 00:00:04 elapsed
25 threads:
Benchmark 1:8.4a5 tclsh8.4-aol 00:00:13 elapsed
Benchmark 2:8.4a5 tclsh8.4t 00:00:37 elapsed
Benchmark 3:8.4a5 tclsh8.4 00:00:04 elapsed
Jeffrey Hobbs