The reference uses treeHash algorithm everytime a signature is generated, thus generating authentication path AND the root, which is not necessary, as the root has only to be generated once. Generating root with every new signature is not efficient, but are there more efficient ways to generate the authentication path without recomputing the xmss root?
My first approach is to save all the xmss leaves during root computation, then create authentication path out of them if needed, but this requires a lot of memory for bigger tree heights.