Isolating Frequently Changed Nodes
A common use case for Revideo is adding subtitles to a video. Often, this gets handled like this:
The implementation shown above can be made significantly faster, especially when we have more words in our subtitles:
The existing implementation repeatedly modifies the view
node by always adding new <Txt/>
elements to it. All of these operations will cause Revideo to reload the view
node and therefore also reload the <Video/>
tag, which takes up a lot of time.
The solution to this is to not add <Txt/>
elements to the view
node directly, but to a child container of view
that is not a parent of our <Video/>
element. Now, we will not reload all children of view
during every <Txt/>
change:
Of course, this does not just apply to <Txt/>
nodes, but any node that you modify frequently.
Last updated