http://codepad.org/gvm3A88k
Timings on my machine: ldc2 -unittest -release -O3: Test time for LockSingleton: 537 msecs. Test time for SyncSingleton: 2 msecs. Test time for AtomicSingleton: 2.25 msecs. dmd -unittest -release -O -inline: Test time for LockSingleton: 451.5 msecs. Test time for SyncSingleton: 7.75 msecs. Test time for AtomicSingleton: 99.75 msecs.