The speed-up has two components. 1/3 of it (in runtime) is due to the built-in SequenceAlignment function. 2/3 of it is due to the way I incorporated it. In particular, I eliminated all control structures and expressed the computation as a composite function (math terminology). This permits the compiler to sequence the computation on the processor stack, affording dramatic speedups.