The cleaner way to do it would be to set core.data to a function, something like:
var data = [... initial data ...];
$(..).jstree({
core : {
data : function (node, cb) {
cb(data); // the var from above, which you can modify at any time
}
})
// when you need to change the tree call:
$(...).jstree(true).refresh();
If you have very large trees consider some sort of lazy loading.
As for redraw_node - that should only be a problem if you have a really large flat list or a fully expanded tree
jstree tries to keep elements in the DOM to a minimum.
I'll try to reduce them even more. I think the i elements for the icons can be replaced by a background-image on the anchor. That will shave off a third of the total number of elements and will remove the need to update the node text using innerHTML when the icon is already there.
As far as performance goes - jstree has workers built-in that are enabled by default. You can make it 30% faster by disabling the workers (the delay is caused by the data transfer from and to the worker), but that means you will block the main UI thread - experiment with this setting if you want (core.worker: http://www.jstree.com/api/#/?q=worker&f=$.jstree.defaults.core.worker )
As for delaying drawing until the nodes are in view - I have thought about that, but I have not had the time to work on such a plugin - there are quite a few caveats - proper height although the nodes are not there, fast checks for nodes about to be visible, etc.
Keep in mind some plugins add extra DOM elements, and also - sometimes additional logic and rendering - which plugins do you have enabled?
I will give the scroll plugin some more thought,
in the mean time - have you tried using the force_text setting - if it is true innerHTML won't be touched, although I doubt creating and appending a text node will be much faster.