Thinking about it more and talking with @algorandskiy, the easiest thing that doesn't require refactoring the merklearray package is to pre-compute all the leaf hashes as the block is built, and that saves you half the work at GenerateBlock time. Going deeper than that is trickier because of the way the leaves are indexed differently in the two implementations.. but the leaf-hash-caching would be lowest hanging fruit for a future optimization PR
Originally posted by @cce in #6339 (comment)