Our expectations are these: - If a handler stack is being used, then a function that enters a lot of handlers -- even if it never raises an exception -- will run slower than an otherwise equivalent function that doesn't enter handlers. Among these programs, we'd expect that k will be slower than g, and h will be slower than f. We would also hope that simply raising an exception is not very expensive relative to ordinary execution, so that f should not be a lot slower than g, and h should not be a lot slower than k. - If code region maps are being used, then a function should not pay at all for entering a handler as long as it never raises an exception, so we'd expect k to be about as fast as g. On the other hand, we'd expect actually raising an exception to be quite expensive, so that f is slower than g and h is slower than k. Now, here are timings of the various programs, taken on a MacBook Pro (2.33 GHz Intel Core 2 Duo) with 2GB, running Mac OS X 10.4.11. SML/NJ v110.67, 10^5 repetitions, sum of user+system+gc time, fastest of 3 runs: f : 0.176 seconds g : 0.176 seconds h : 2.209 seconds k : 1.421 seconds Sun java version 1.5.0_13, 10^4 repetitions, sum of user + sys time, fastest of 3 runs: f : 1.291 seconds g : 0.131 seconds h : 4.132 seconds k : 0.171 seconds Based on these timings, we see consistent evidence that SML/NJ is using a handler stack and java is using code region maps. (And inspection of the code for the compilers/runtime systems shows that this is in fact the case.)