That indeed would be a potential way as well. Doing the "dictionary way". Each treeview node is a typeinstance. This typeh as a "childs" list which uses TMap ...
But this depends on the amount of childs there normally are. if log2(childs) isn't significantly smaller than childs (number of childs) then it doesn't make that much sense to use a TMap.
but if you have 10+ childs on each treeview node it will start to make a significant difference when jumping down the tree.
Another way is just 1 TMap ... and put all nodes in there with their node text as key.
Thats very fast as well.
don't know if the "encoding" would make it faster than one of the above solutions as decoding needs time as well
But this depends on the amount of childs there normally are. if log2(childs) isn't significantly smaller than childs (number of childs) then it doesn't make that much sense to use a TMap.
but if you have 10+ childs on each treeview node it will start to make a significant difference when jumping down the tree.
Another way is just 1 TMap ... and put all nodes in there with their node text as key.
Thats very fast as well.
don't know if the "encoding" would make it faster than one of the above solutions as decoding needs time as well