I have finally commited the improved memory allocator from the AOLServer
Tcl mods to the 8.4 branch.

Some will recall that this alternative allocator has been around since
AOL started modifying 7.6.  We took a wack at putting this in earlier,
but purify barfed or some special condition didn't work.  Taking the
latest changes from Jim Davidson, I massaged the Windows code to work
and fixed it all up to be easily switchable (needs USE_THREAD_ALLOC to
be defined - this is now the default on Unix with --enable-threads).

The performance of this change can be seem simply here (this is a
tclbench run using about 6 threads in the threaded Tcls):

Benchmark 1:8.4a5 /home/jeffh/install/linux-ix86/bin/tclsh8.4-thread-aol
 00:00:54 elapsed
Benchmark 2:8.4a5 /home/jeffh/install/linux-ix86/bin/tclsh8.4-thread
 00:06:28 elapsed
Benchmark 3:8.4a5 /home/jeffh/install/linux-ix86/bin/tclsh8.4
 00:00:46 elapsed

Yes, under heavy thread load, the new allocator is 6.5 times faster.
Still slightly slower than pure-non-threaded Tcl.  The main facet is
that lock contention is significantly reduced by having per-thread
allocators.

This should all be transparent to the end user, as it plugs in very
low under ckalloc.  I'll be doing more work on Windows to satisfy
myself that it cleans up OK and all that and then this will likely
be the default allocator when threaded on Windows as well.

Jeff

Reply via email to