You are quite right, and this is the problem I had to solve. In my very first reply to you I described how I did it.
To elaborate, there are two performance problems:
The first is that, because LiveView does not properly diff containers (or nested containers), the diffs sent down the socket are excessively large. The correct solution is for LV to diff containers (I think they’re working on it), but as a temporary fix you can wrap your nodes in LiveComponents to shrink the diffs down to constant. This is the performance advice I gave you.
The second is that you have to hold the entire tree in-memory on the server. This is the price of using LiveView and I accept it, so I made no attempt to fix this. If this is a real problem (you have a truly large tree, hundreds of thousands of nodes), then you will have to resort to some very advanced tactics. You could probably virtualize (i.e. paginate, in a nested fashion) the tree on the server. Note that you still don’t need streams to do that.






















