You have to do a depth first recursion (or whatever)

through the source tree in display order, so that

you always add TVI_LAST. I'm doing an 8 level 4000

member tree this way and it builds in about 300ms.